Initailly, once the game is started, the user is prompted to make a move from 1-9 which is then fed to the function:īoards is a list of list which contains the state of each sub-board. ![]() All i need is the best value and once i get that, i can retrieve the index from that state. The communication with the board is already handled. The problem is that when i run the code and it is the time for bot to play its move, it runs endlessly without coming to a conclusion and returning a best_move. I am using minimax algorithm with alpha-beta pruning to find out the best move for the bot to play. I am trying to make an ultimate tic-tac-toe game in python which is a little different than the actual one in a way that this game ends when there is a win in any one sub-board.
0 Comments
Leave a Reply. |