From 51d27e1ab9058c9e0fafb399e22edf7b38470510 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 27 Jul 2026 20:14:54 +0200 Subject: adding uci --- src/bot.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/bot.cpp') diff --git a/src/bot.cpp b/src/bot.cpp index e3a39f2..d0730d8 100644 --- a/src/bot.cpp +++ b/src/bot.cpp @@ -17,7 +17,7 @@ const int SEARCH_DEPTH = 3; int positions_consider = 0; -Move EngineGetBestMove(Board *b) { +Move EngineGetBestMove(Game *b) { auto moves = GetLegalMoves(b); if (moves.size() == 0) { assert(false && "Unhanled error zero legal moves for bot"); @@ -25,7 +25,7 @@ Move EngineGetBestMove(Board *b) { Move bestMove = moves[0]; float BestEval = (b->turn ? -INFINITY : INFINITY); for (Move move : moves) { - Board TestBoard = *b; + Game TestBoard = *b; PlayMove(move, &TestBoard); float alpha = -INFINITY; float beta = INFINITY; @@ -46,7 +46,7 @@ Move EngineGetBestMove(Board *b) { std::cout << "\nConsider: " << positions_consider << "\n"; return bestMove; } -float minimax(int depth, Board *b, float alpha, float beta) { +float minimax(int depth, Game *b, float alpha, float beta) { if (depth == 0) { return EvaluateBoardForWhite(b); } @@ -58,7 +58,7 @@ float minimax(int depth, Board *b, float alpha, float beta) { float bestEval = -INFINITY; for (Move move : moves) { - Board next = *b; + Game next = *b; PlayMove(move, &next); float eval = minimax(depth - 1, &next, alpha, beta); @@ -76,7 +76,7 @@ float minimax(int depth, Board *b, float alpha, float beta) { float BestEval = INFINITY; for (Move move : moves) { - Board next = *b; + Game next = *b; PlayMove(move, &next); float eval = minimax(depth - 1, &next, alpha, beta); @@ -92,7 +92,7 @@ float minimax(int depth, Board *b, float alpha, float beta) { } } -float EvaluateBoardForWhite(Board *b) { +float EvaluateBoardForWhite(Game *b) { positions_consider++; float score = 0; -- cgit v1.2.3