aboutsummaryrefslogtreecommitdiff
path: root/src/repl.cpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-07-27 15:14:01 +0200
committerAdam <adammegarules1@gmail.com>2026-07-27 15:14:01 +0200
commit35b21c6d970857dd945c5dfa476a27c8c2a8b1f6 (patch)
tree68547059dfd9c402cfe535cf5b89f84c47a77687 /src/repl.cpp
parent03437563f91a6f760fa8b0283e2e74586a9c7dac (diff)
adding bot
Diffstat (limited to 'src/repl.cpp')
-rw-r--r--src/repl.cpp9
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);