Fail soft #13

Merged
rektdie merged 7 commits from fail_soft into legalMovegen 2025-03-09 09:35:27 +01:00
Showing only changes of commit ec9c2e7348 - Show all commits
+2 -5
View File
@@ -95,15 +95,12 @@ static SearchResults Quiescence(Board board, int alpha, int beta) {
} }
int staticScore = Evaluate(board); int staticScore = Evaluate(board);
int bestScore = alpha;
if (staticScore >= beta) { if (staticScore >= beta) {
return staticScore; return staticScore;
} }
if (staticScore > bestScore) { int bestScore = staticScore;
bestScore = staticScore;
}
GenerateMoves(board, board.sideToMove); GenerateMoves(board, board.sideToMove);
@@ -115,7 +112,7 @@ static SearchResults Quiescence(Board board, int alpha, int beta) {
if (board.moveList[i].IsCapture()) { if (board.moveList[i].IsCapture()) {
Board copy = board; Board copy = board;
copy.MakeMove(board.moveList[i]); copy.MakeMove(board.moveList[i]);
int score = -Quiescence(copy, -beta, -bestScore).score; int score = -Quiescence(copy, -beta, -alpha).score;
if (score >= beta) { if (score >= beta) {
return score; return score;