From 5e110019a34df63e55295968073357a8a9eeac9f Mon Sep 17 00:00:00 2001 From: rektdie Date: Mon, 10 Mar 2025 08:22:51 +0100 Subject: [PATCH] some minor refactoring --- source/search.cpp | 12 +++++------- source/uci.cpp | 2 -- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index ceda5a0..8de118d 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -94,9 +94,7 @@ static SearchResults Quiescence(Board board, int alpha, int beta) { } } - int staticScore = Evaluate(board); - - int bestScore = staticScore; + int bestScore = Evaluate(board); if (bestScore>= beta) { return bestScore; @@ -188,11 +186,7 @@ SearchResults PVS(Board board, int depth, int alpha, int beta) { } } - int score = -inf; - int nodeType = AllNode; - GenerateMoves(board, board.sideToMove); - SortMoves(board); if (board.currentMoveIndex == 0) { if (board.InCheck(board.sideToMove)) { // checkmate @@ -202,6 +196,10 @@ SearchResults PVS(Board board, int depth, int alpha, int beta) { } } + SortMoves(board); + + int score = -inf; + int nodeType = AllNode; SearchResults results(-inf); // For all moves diff --git a/source/uci.cpp b/source/uci.cpp index 1adbcfc..9ca743f 100644 --- a/source/uci.cpp +++ b/source/uci.cpp @@ -180,8 +180,6 @@ void UCILoop(Board &board) { // define user / GUI input buffer std::string input = ""; - PrintEngineInfo(); - // main loop while (true) { // reset user / GUI input