aboutsummaryrefslogtreecommitdiff
path: root/src/repl.cpp
diff options
context:
space:
mode:
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);