Fp #33

Merged
rektdie merged 5 commits from FP into main 2025-03-26 17:15:15 +01:00
Showing only changes of commit 58a3e8f792 - Show all commits
+5 -6
View File
@@ -231,21 +231,20 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
for (int i = 0; i < board.currentMoveIndex; i++) { for (int i = 0; i < board.currentMoveIndex; i++) {
Move currMove = board.moveList[i]; Move currMove = board.moveList[i];
Board copy = board;
bool isLegal = copy.MakeMove(currMove);
if (!isLegal) continue;
// Futility pruning // Futility pruning
// If our static eval is far below alpha, there is only a small chance // If our static eval is far below alpha, there is only a small chance
// that a quiet move will help us so we skip them // that a quiet move will help us so we skip them
int fpMargin = 100; int fpMargin = 100;
if (!isPV && !board.InCheck() && currMove.IsQuiet() if (!isPV && !board.InCheck() && currMove.IsQuiet()
&& depth <= 2 && staticEval + fpMargin < alpha) { && depth <= 2 && staticEval + fpMargin < alpha) {
positionIndex--;
continue; continue;
} }
Board copy = board;
bool isLegal = copy.MakeMove(currMove);
if (!isLegal) continue;
int reductions = GetReductions(board, currMove, depth, moveSeen, ply); int reductions = GetReductions(board, currMove, depth, moveSeen, ply);
// First move (suspected PV node) // First move (suspected PV node)