This repository contains two versions of the Connect Four game implemented in Python along with AI opponents using different algorithms: Minimax and Monte Carlo Simulation.
The Minimax version of Connect Four implements an AI opponent using the minimax algorithm. This algorithm is a search algorithm commonly used in decision trees and game playing.
To play the game against the minimax AI:
- Navigate to the
connect-4-minimax
directory. - Run the
connect-4.py
script. - Follow the prompts to play against the AI opponent.
The Monte Carlo version of Connect Four implements an AI opponent using the Monte Carlo Simulation algorithm. This algorithm is a probabilistic method for estimating the possible outcomes of a decision by simulating random outcomes.
To play the game against the Monte Carlo AI:
- Navigate to the
connect-4-monte-carlo
directory. - Run the
connect-4.py
script. - Follow the prompts to play against the AI opponent.
Both versions of the game require Python 3.x to be installed on your system.
Additionally, the following Python packages are used:
numpy
: For efficient numerical operations.termcolor
: For colored output in the terminal.
You can install these packages using pip
Starter code was provided by Professor Avi Rosenfeld