Welcome to the Connect4 Game project! This project includes two files - connect4.py
and Connect4GUI.py
- providing both a simple terminal-based version and a graphical user interface (GUI) version of the classic Connect Four game.
connect4.py
is a simple implementation of Connect Four in the terminal. The game board is represented as a 6x7 matrix, where Player 1 is represented by the token '1', and Player 2 is represented by the token '2'. Players take turns to drop their tokens into columns, aiming to connect four of their tokens either horizontally, vertically, or diagonally.
- Run the script:
python connect4.py
- Enter the column number where you want to drop your token.
- Alternate turns between Player 1 and Player 2.
- The first player to connect four tokens in a row wins!
Connect4GUI.py
is a graphical version of Connect Four implemented using the pygame library. This version features a visual dialog box where Player 1 plays with Red Tokens, and Player 2 plays with Yellow Tokens. The GUI enhances the gaming experience with a more interactive and visually appealing interface.
- Run the script:
python Connect4GUI.py
- Click on the column where you want to drop your token.
- Players take turns clicking, and the game continues until there's a winner or a draw.
- Enjoy the graphical representation of the classic Connect Four game.
- Python 3.x
- Pygame library (install using
pip install pygame
)
Feel free to explore and modify the code to enhance the game or add new features. Happy gaming!