implemented RFP with a margin of 100

This commit is contained in:
rektdie committed 2025-03-06 22:28:24 +01:00
1 parent 8b5cb45726
commit 6b9eb61a2f
1 file changed
+12 -1
+12 -1
View File
@@ -153,14 +153,23 @@ SearchResults PVS(Board board, int depth, int alpha, int beta) {
}
}
const int staticEval = Evaluate(board);
if (depth <= 0) return Quiescence(board, alpha, beta);
if (board.InCheck(board.sideToMove)) {
depth++;
} else {
if (ply) {
// Reverse Futility Pruning
int margin = 100 * depth;
if (staticEval - margin >= beta && depth < 7) {
return staticEval;
}
// Null Move Pruning
if (!doingNullMove) {
if (ply && depth >= 3 && !board.InPossibleZug(board.sideToMove)) {
if (depth >= 3 && !board.InPossibleZug(board.sideToMove)) {
Board copy = board;
copy.MakeMove(Move());
@@ -176,6 +185,8 @@ SearchResults PVS(Board board, int depth, int alpha, int beta) {
}
}
}
int score = -inf;
int nodeType = AllNode;