diff options
| author | Adam <adammegarules1@gmail.com> | 2026-07-27 20:14:54 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-07-27 20:14:54 +0200 |
| commit | 51d27e1ab9058c9e0fafb399e22edf7b38470510 (patch) | |
| tree | f0528298123fcb33eb426a5aa099afd2a8d00a90 /src/bot.cpp | |
| parent | f1ded0290393709d437c6e149861ceb91d241c64 (diff) | |
adding uci
Diffstat (limited to 'src/bot.cpp')
| -rw-r--r-- | src/bot.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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; |
