An implementation of (an AI for) the classic board game Connect Four. The AI uses Monte Carlo Tree Search to choose its actions. In particular, it uses Upper Confidence Bound 1 applied to trees (UCT) as the tree policy. Try and see if you can beat it!
The main dependency is the SDL2 library used for the GUI. To run the project, you'll need the following:
- cmake >= 3.7
- make >= 4.1 for Linux and Mac, 3.81 for Windows
- gcc/g++ >= 7.0
- SDL2 >= 2.0 (https://wiki.libsdl.org/Installation)
Make sure all of the dependencies mentioned above are installed. Then, clone and enter the repo:
git clone https://github.com/leotappe/connect-four.git
cd connect-four
Create and enter a build directory:
mkdir build
cd build
Compile using cmake and make:
cmake ..
make
There should now be an executable in your build directory named connect4
. You can run it using
./connect4
Have fun!
I used the following material to learn about Monte Carlo Tree Search: