mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-12 09:02:41 +01:00
CuckooChess: Don't use LMP when alpha or beta is a mate score.
This commit is contained in:
@@ -756,6 +756,7 @@ public class Evaluate {
|
||||
}
|
||||
|
||||
private int threatBonus(Position pos) {
|
||||
// FIXME!! Try higher weight for attacks on more valuable pieces.
|
||||
int score = 0;
|
||||
|
||||
// Sum values for all black pieces under attack
|
||||
|
||||
@@ -53,7 +53,7 @@ public interface Player {
|
||||
|
||||
/**
|
||||
* Inform player that the transposition table should be cleared.
|
||||
* Of coarse, a human player has a hard time implementing this.
|
||||
* Of course, a human player has a hard time implementing this.
|
||||
*/
|
||||
public void clearTT();
|
||||
}
|
||||
|
||||
@@ -734,14 +734,16 @@ public class Search {
|
||||
boolean givesCheck = MoveGen.givesCheck(pos, m);
|
||||
boolean doFutility = false;
|
||||
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 ((Math.abs(alpha) <= MATE0 / 2) && (Math.abs(beta) <= MATE0 / 2)) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ public class TextIO {
|
||||
ret.append("O-O-O");
|
||||
}
|
||||
} else if (move.from == bKingOrigPos && pos.getPiece(bKingOrigPos) == Piece.BKING) {
|
||||
// Check white castle
|
||||
// Check black castle
|
||||
if (move.to == Position.getSquare(6, 7)) {
|
||||
ret.append("O-O");
|
||||
} else if (move.to == Position.getSquare(2, 7)) {
|
||||
|
||||
Reference in New Issue
Block a user