diff options
| author | Adam <adammegarules1@gmail.com> | 2026-07-27 15:14:01 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-07-27 15:14:01 +0200 |
| commit | 35b21c6d970857dd945c5dfa476a27c8c2a8b1f6 (patch) | |
| tree | 68547059dfd9c402cfe535cf5b89f84c47a77687 /src/repl.cpp | |
| parent | 03437563f91a6f760fa8b0283e2e74586a9c7dac (diff) | |
adding bot
Diffstat (limited to 'src/repl.cpp')
| -rw-r--r-- | src/repl.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/repl.cpp b/src/repl.cpp index 8eae719..ce545d1 100644 --- a/src/repl.cpp +++ b/src/repl.cpp @@ -1,5 +1,6 @@ #include "repl.hpp" #include "board.hpp" +#include "bot.hpp" #include "moves.hpp" #include <algorithm> #include <cctype> @@ -53,13 +54,7 @@ int startREPL(Board *b) { } if (b->state == TURN) { if (b->turn == false) { - auto moves = GetLegalMoves(b); - std::srand( - std::time(0)); // use current time as seed for random generator - int random_pos = std::rand() % - moves.size(); // Modulo to restrict the number of - // random values to be at most A.size()-1 - Move move = moves[random_pos]; + Move move = EngineGetBestMove(b); PlayMove(move, b); b->turn = !b->turn; printBoard(b); |
