This is an implementation of the classic Connect Four game in Python, emphasizing the use of Object-Oriented Programming (OOP) principles.
- Two-player mode: Human vs. Human.
- Single-player mode: Human vs. Computer (computer makes random, but valid, moves).
- Text-based UI with clear game state display and interaction prompts.
-
Prerequisites: Ensure you have Python (version 3.7 or later) installed on your machine.
-
Clone the Repository:
git clone (https://github.com/micapareddes/connect-four.git)
-
Navigate to the location where you've downloaded or cloned the file.
-
Run the Game:
python connect_four.py
-
Follow on-screen prompts to play game.
- Players take turns to drop a disc into one of the seven columns.
- The aim is to be the first to connect four of one's discs in a row, either vertically, horizontally, or diagonally.
- If the board fills up before either player achieves this, the game is a draw.
- The game starts immediately upon script execution. It could benefit from a menu or start option.
- Some parts of the code contain commented-out blocks which should be cleaned up for clarity.
- The computer's moves are entirely random. This could make it relatively easy for an experienced player to win against the computer.
- A visual interface will be added using the Pygame library.
- Implement a smarter AI opponent that uses strategies to block the player and create its winning paths.
- Optimize the algorithms for checking win conditions, potentially using more efficient techniques.
If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcomed.
This was my initial attempt at applying Object-Oriented Programming (OOP). While the basics of OOP were implemented, there's room for improvement and optimization in the architecture.