From 865fb13b900a9980ab7f818106c4160369a0db76 Mon Sep 17 00:00:00 2001 From: rektdie Date: Tue, 25 Mar 2025 14:22:52 +0100 Subject: [PATCH] expanded QS to noisy moves instead of only captures | bench 902872 --- source/search.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 9570f12..42db995 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -137,23 +137,21 @@ static SearchResults Quiescence(Board board, int alpha, int beta, int ply) { SearchResults results; for (int i = 0; i < board.currentMoveIndex; i++) { - if (board.moveList[i].IsCapture()) { - Board copy = board; - int isLegal = copy.MakeMove(board.moveList[i]); - if (!isLegal) continue; - int score = -Quiescence(copy, -beta, -alpha, ply + 1).score; - positionIndex--; + Board copy = board; + int isLegal = copy.MakeMove(board.moveList[i]); + if (!isLegal) continue; + int score = -Quiescence(copy, -beta, -alpha, ply + 1).score; + positionIndex--; - if (score >= beta) { - return score; - } + if (score >= beta) { + return score; + } - bestScore = std::max(score, bestScore); + bestScore = std::max(score, bestScore); - if (score > alpha) { - alpha = score; - results.bestMove = board.moveList[i]; - } + if (score > alpha) { + alpha = score; + results.bestMove = board.moveList[i]; } } -- 2.47.3