expanded QS to noisy moves instead of only captures | bench 902872 #29

Merged
rektdie merged 1 commits from qs_noisy into main 2025-03-25 15:57:37 +01:00
Showing only changes of commit 865fb13b90 - Show all commits
+12 -14
View File
@@ -137,23 +137,21 @@ static SearchResults Quiescence(Board board, int alpha, int beta, int ply) {
SearchResults results; SearchResults results;
for (int i = 0; i < board.currentMoveIndex; i++) { for (int i = 0; i < board.currentMoveIndex; i++) {
if (board.moveList[i].IsCapture()) { Board copy = board;
Board copy = board; int isLegal = copy.MakeMove(board.moveList[i]);
int isLegal = copy.MakeMove(board.moveList[i]); if (!isLegal) continue;
if (!isLegal) continue; int score = -Quiescence(copy, -beta, -alpha, ply + 1).score;
int score = -Quiescence(copy, -beta, -alpha, ply + 1).score; positionIndex--;
positionIndex--;
if (score >= beta) { if (score >= beta) {
return score; return score;
} }
bestScore = std::max(score, bestScore); bestScore = std::max(score, bestScore);
if (score > alpha) { if (score > alpha) {
alpha = score; alpha = score;
results.bestMove = board.moveList[i]; results.bestMove = board.moveList[i];
}
} }
} }