implemented RFP with a margin of 100 #12

Merged
rektdie merged 1 commits from RFP into legalMovegen 2025-03-07 09:15:26 +01:00
Showing only changes of commit 6b9eb61a2f - Show all commits
+13 -2
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 (depth <= 0) return Quiescence(board, alpha, beta);
if (board.InCheck(board.sideToMove)) { if (board.InCheck(board.sideToMove)) {
depth++; depth++;
} else { } else {
//Null Move Pruning if (ply) {
// Reverse Futility Pruning
int margin = 100 * depth;
if (staticEval - margin >= beta && depth < 7) {
return staticEval;
}
// Null Move Pruning
if (!doingNullMove) { if (!doingNullMove) {
if (ply && depth >= 3 && !board.InPossibleZug(board.sideToMove)) { if (depth >= 3 && !board.InPossibleZug(board.sideToMove)) {
Board copy = board; Board copy = board;
copy.MakeMove(Move()); copy.MakeMove(Move());
@@ -176,6 +185,8 @@ SearchResults PVS(Board board, int depth, int alpha, int beta) {
} }
} }
}
int score = -inf; int score = -inf;
int nodeType = AllNode; int nodeType = AllNode;