implemented RFP with a margin of 100
This commit is contained in:
1 parent
8b5cb45726
commit
6b9eb61a2f
1 file changed
+12
-1
+12
-1
@@ -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 {
|
||||||
|
if (ply) {
|
||||||
|
// Reverse Futility Pruning
|
||||||
|
int margin = 100 * depth;
|
||||||
|
if (staticEval - margin >= beta && depth < 7) {
|
||||||
|
return staticEval;
|
||||||
|
}
|
||||||
|
|
||||||
// Null Move Pruning
|
// 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;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user