A Python implementation of the classic Connect Four game.
This project features two modes of play:
- A text-based Command Line Interface (CLI)
- A Graphical User Interface (GUI).
Visual gameplay demonstration against the AI on Hard Mode.
Text-based gameplay against the AI on Hard Mode.
Ensure you have Python installed. This project relies on specific library versions to function correctly. A requirements.txt file is included to ensure compatibility.
To install all dependencies, run the following command in the project root directory:
pip install -r requirements.txtThis project includes two entry points depending on how you wish to play the game.
To play the text-based version (using rich for formatting):
python run_cli.pyTo play the visual version (using pyglet):
python run_gui.pyThe project uses pytest for unit testing. To execute the test suite:
python -m pytest| Item | Description |
|---|---|
cli/ |
Contains the core game logic and the text-based interface implementation. |
gui/ |
Contains the code for the Graphical User Interface window and rendering. |
tests/ |
Unit tests to ensure game logic validity. |
replays/ |
Directory where game replay logs are stored. |
docs/ |
Project documentation and README assets (screenshots/GIFs). |
requirements.txt |
A list of all Python dependencies and versions required to run the project. |
run_cli.py |
The entry point script to launch the CLI game. |
run_gui.py |
The entry point script to launch the GUI game. |

