From 35b21c6d970857dd945c5dfa476a27c8c2a8b1f6 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 27 Jul 2026 15:14:01 +0200 Subject: adding bot --- src/repl.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/repl.cpp') 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 #include @@ -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); -- cgit v1.2.3