Fp #33

Merged
rektdie merged 5 commits from FP into main 2025-03-26 17:15:15 +01:00
2 changed files with 16 additions and 1 deletions
Showing only changes of commit 2c1d448d8f - Show all commits

No files matched your search

+6 -1
View File
@@ -49,12 +49,17 @@ public:
return m_move >> 12; return m_move >> 12;
} }
int IsCapture() { bool IsCapture() {
return (GetFlags() == capture || GetFlags() == epCapture return (GetFlags() == capture || GetFlags() == epCapture
|| GetFlags() == knightPromoCapture || GetFlags() == bishopPromoCapture || GetFlags() == knightPromoCapture || GetFlags() == bishopPromoCapture
|| GetFlags() == rookPromoCapture || GetFlags() == queenPromoCapture); || GetFlags() == rookPromoCapture || GetFlags() == queenPromoCapture);
} }
bool IsQuiet() {
return (GetFlags() == quiet || GetFlags() == kingCastle
|| GetFlags() == queenCastle || GetFlags() == doublePawnPush);
}
void PrintMove() { void PrintMove() {
std::cout << squareCoords[MoveFrom()] << squareCoords[MoveTo()]; std::cout << squareCoords[MoveFrom()] << squareCoords[MoveTo()];
+10
View File
@@ -236,6 +236,16 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
if (!isLegal) continue; if (!isLegal) continue;
// Futility pruning
// 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
int fpMargin = 100;
if (!isPV && !board.InCheck() && currMove.IsQuiet()
&& depth <= 2 && staticEval + fpMargin < alpha) {
positionIndex--;
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)