Merge pull request #12 from rektdie/RFP
implemented RFP with a margin of 100
This commit was merged in pull request #12.
This commit is contained in:
1 file changed
+13
-2
+13
-2
@@ -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 {
|
||||
//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 (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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user