diff --git a/CuckooChessEngine/src/chess/ComputerPlayer.java b/CuckooChessEngine/src/chess/ComputerPlayer.java index 91977cd..f5a1b92 100644 --- a/CuckooChessEngine/src/chess/ComputerPlayer.java +++ b/CuckooChessEngine/src/chess/ComputerPlayer.java @@ -30,7 +30,7 @@ public class ComputerPlayer implements Player { public static final String engineName; static { - String name = "CuckooChess 1.13a7"; + String name = "CuckooChess 1.13a8"; String m = System.getProperty("sun.arch.data.model"); if ("32".equals(m)) name += " 32-bit"; diff --git a/CuckooChessEngine/src/chess/Search.java b/CuckooChessEngine/src/chess/Search.java index 04d39e8..844b127 100644 --- a/CuckooChessEngine/src/chess/Search.java +++ b/CuckooChessEngine/src/chess/Search.java @@ -712,8 +712,16 @@ public class Search { boolean mayReduce = (m.score < 53) && (!isCapture || m.score < 0) && !isPromotion; boolean givesCheck = MoveGen.givesCheck(pos, m); boolean doFutility = false; - if (futilityPrune && mayReduce && haveLegalMoves) { - if (!givesCheck && !passedPawnPush(pos, m)) + if (mayReduce && haveLegalMoves && !givesCheck && !passedPawnPush(pos, m)) { + int moveCountLimit; + if (depth <= plyScale) moveCountLimit = 3; + else if (depth <= 2 * plyScale) moveCountLimit = 6; + else if (depth <= 3 * plyScale) moveCountLimit = 12; + else if (depth <= 4 * plyScale) moveCountLimit = 24; + else moveCountLimit = 256; + if (mi >= moveCountLimit) + continue; // Late move pruning + if (futilityPrune) doFutility = true; } int score; diff --git a/CuckooChessEngine/test/chess/SearchTest.java b/CuckooChessEngine/test/chess/SearchTest.java index 2c4bfc3..244776b 100644 --- a/CuckooChessEngine/test/chess/SearchTest.java +++ b/CuckooChessEngine/test/chess/SearchTest.java @@ -177,7 +177,7 @@ public class SearchTest { pos = TextIO.readFEN("7k/5RR1/8/8/8/8/1q3q2/3K4 w - - 0 1"); sc = new Search(pos, nullHist, 0, tt); sc.maxTimeMillis = -1; - score = idSearch(sc, 3).score; + score = idSearch(sc, 4).score; assertTrue(score < 0); pos = TextIO.readFEN("7k/5RR1/8/8/8/8/1q3q2/3K4 w - - 0 1");