This project implements the classic Connect 4 game with an optional Artificial Intelligence (AI) opponent. The objective remains the same: strategically place your colored discs to achieve a horizontal, vertical, or diagonal line of four pieces to win. This project offers an engaging way to hone your Connect 4 skills or challenge the AI.
AI algorithms: A*, Predictive A*, Alpha Beta Pruning and Monte Carlo Tree Search.
Prerequisites:
- Python 3.x (https://www.python.org/downloads/)
- pip (package installer for Python - usually included with Python installation)
Installing Dependencies:
- Open your terminal or command prompt.
- Navigate to the project directory using the
cd
command. - Run the following command to install required dependencies listed in
requirements.txt
:
pip install -r requirements.txt
Running the game
- Open your terminal or command prompt.
- Navigate to the project directory using the
cd
command. - Run the following command to play the game.
python3 main.py