From 419f931a8001ca1c8c5960d68ae6bdef53c76f16 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 18 Aug 2026 11:26:44 +0200 Subject: refactor(book): refactoring opening book code --- src/uci.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'src/uci.cpp') diff --git a/src/uci.cpp b/src/uci.cpp index 23e8419..812a0cd 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -13,8 +13,8 @@ #include "board/board.hpp" #include "board/fen.hpp" -#include "bot.hpp" #include "book.hpp" +#include "bot.hpp" #include "misc.hpp" #include "moves.hpp" #include "uci.hpp" @@ -224,24 +224,13 @@ static void GoCommand(Game *game, std::string &cmd) { exit(1); } - // Try opening book first - uint16_t bookMove = 0; - if (game->MoveClock < GetBookDepth()) { - bookMove = ProbeBook(GenerateZobristKey(game)); - } - - uint16_t best; - if (bookMove != 0) { - best = bookMove; - } else { - move_options options = { - .wtime = wtime, - .btime = btime, - .wncr = wncr, - .bncr = bncr, - }; - best = GetBestMove(game, depth, options); - } + move_options options = { + .wtime = wtime, + .btime = btime, + .wncr = wncr, + .bncr = bncr, + }; + uint16_t best = GetBestMove(game, depth, options); Piece piece = game->pieces[getFromValueFromMove(best)]; -- cgit v1.2.3