This is a Python implementation of the classic Connect Four game. Players can play against an AI with adjustable difficulty levels or against another human player.
- Play against AI or another human player
- 10 AI difficulty levels ranging from Very Easy to Legendary
- Command-line interface
- Minimax algorithm with alpha-beta pruning for AI moves
- Run the game script
- Choose your opponent (AI or human player)
- If playing against AI, select the difficulty level
- Take turns dropping pieces into the columns
- The first player to connect four pieces horizontally, vertically, or diagonally wins!
- Very Easy
- Easy
- Medium
- Hard
- Expert
- Master
- Impossible
- Inhuman
- Godlike
- Legendary
Note: Higher difficulty levels (9 and 10) may take up to 10 minutes for the AI to make a move.
- Python 3.x
- Clone this repository
- Navigate to the project directory
- Run the game using Python:
python main.py
main.py
: The main game scriptBoard.py
: Contains the Board class for game board operationsConnectFour.py
: Contains the ConnectFour class for game logicconfig.py
: Configuration file with game constants
Feel free to fork this project and submit pull requests with improvements or bug fixes.