CuckooChess: Implemented late move pruning.

This commit is contained in:
Peter Osterlund
2011-12-04 17:32:22 +00:00
parent c53f582581
commit 7168e4be6e
3 changed files with 12 additions and 4 deletions

View File

@@ -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";

View File

@@ -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;