This is a simple Connect Four game implemented in Python using object-oriented programming. The game allows two players to take turns and place their tokens (X or O) in a 6x7 grid. The first player to connect four tokens horizontally, vertically, or diagonally wins!
-
6x7 game board displayed in the console.
-
Two-player mode (no AI, human vs human).
-
Input validation for column selection.
-
Automatic checking for winning conditions in all directions.
- Clone this repository:
git clone https://github.com/khadibd/Connect-Four-Console-Game-Python-OOP- Navigate to the folder:
cd ConnectFourGame- Run the game:
python connect_game.py- Follow the prompts to enter the column number for your move. Example
Player X give the column to play: 3
[['-', '-', '-', '-', '-', '-', '-'],
['-', '-', '-', '-', '-', '-', '-'],
['-', '-', '-', '-', '-', '-', '-'],
['-', '-', '-', '-', '-', '-', '-'],
['-', '-', '-', 'X', '-', '-', '-'],
['-', '-', '-', '-', '-', '-', '-']]Eng. Khadija Bouadi
For any queries, reach out to:
GitHub: @khadibd
Email: khadibd00@gmail.com