https://github.com/soham2002/connect4
This project provides a dual experience of Connect Four: a classic terminal-based version and an interactive graphical version using the pygame library.
https://github.com/soham2002/connect4
Last synced: 5 months ago
JSON representation
This project provides a dual experience of Connect Four: a classic terminal-based version and an interactive graphical version using the pygame library.
- Host: GitHub
- URL: https://github.com/soham2002/connect4
- Owner: soham2002
- Created: 2024-01-25T19:28:47.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-19T11:33:13.000Z (about 2 years ago)
- Last Synced: 2025-07-22T18:40:17.287Z (11 months ago)
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Connect4 Game Project
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
### Description
`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.
### How to Play
1. Run the script: `python connect4.py`
2. Enter the column number where you want to drop your token.
3. Alternate turns between Player 1 and Player 2.
4. The first player to connect four tokens in a row wins!
## Connect4GUI.py
### Description
`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.
### How to Play
1. Run the script: `python Connect4GUI.py`
2. Click on the column where you want to drop your token.
3. Players take turns clicking, and the game continues until there's a winner or a draw.
4. Enjoy the graphical representation of the classic Connect Four game.
### Requirements
- 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!