An intuitive minimax decision tree visualization tool on the games of TicTacToe and Connect4.
- (Completed) Build a TicTacToe game and a computer player with a minimax algorithm. (Done. Credits to Kylie Ying
- (Completed) Build a Connect4 game and a computer player with minimax algorithm. (Done. However, it takes too long to make a decision due to the exponential increase in number of possible outcomes.)
- (Done for TicTacToe) Build a python GUI using tkinter to visualize the possible next moves the computer sees and the respective scores for each move.
- (Completed) Implement alpha-beta pruning algorithm. (However, it still takes too long to make a decision.)
- (To Do) Consider Deep Reinforcement Learning for Connect4 and pit both algorithms against each other. (excites!)
- (To Do) Consider using a web-based application for easier accessibility.
- Clone this repo into a local directory and navigate to
./tictactoe-minimax-visualizer. - Run in terminal.
python game.py - Have fun!
- Clone this repo into a local directory and navigate to the directory.
- Run in terminal.
python tictactoe.py - Choose players.
- Have fun!
- Clone this repo into a local directory and navigate to the directory.
- Run in terminal.
python connect4.py - Choose players.
- Have fun!
The Minimax algorithm is an algorithm which is used in decision-making and game theory. It provides an optimal move for the player assuming that the opponent is also playing optimally. It uses recursion to search through the game tree and computes the minimax decision for the current state.
The Minimax algorithm performs a depth-first search algorithm for the exploration of the complete game tree and proceeds all the way down to the terminal node of the tree, then backtracks to determine the other sibling terminal nodes while assigning the scores to the respective possible next moves.