https://github.com/bearlike/connect-4
:video_game: Connect Four (also known as 4-in-a-row) is an exciting two-player puzzle connection game recreated with PyGame and Python.
https://github.com/bearlike/connect-4
connect-four gamespy
Last synced: over 1 year ago
JSON representation
:video_game: Connect Four (also known as 4-in-a-row) is an exciting two-player puzzle connection game recreated with PyGame and Python.
- Host: GitHub
- URL: https://github.com/bearlike/connect-4
- Owner: bearlike
- Created: 2018-12-02T17:28:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-17T13:25:04.000Z (over 4 years ago)
- Last Synced: 2025-01-04T19:25:06.575Z (over 1 year ago)
- Topics: connect-four, gamespy
- Language: Python
- Homepage:
- Size: 481 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Connect-4
============
[](https://www.python.org)
[](http://www.pygame.org/news.html)
[](https://github.com/KrishnaAlagiri/Connect-4#connect-4)
About
-----
Connect Four is a two-player connection game in which the players first choose a colour and then take turns dropping one coloured disc from the top into a seven-column, six-row vertically suspended grid. The pieces fall straight down, occupying the next available space within the column. The objective of the game is to be the first to form a horizontal, vertical, or diagonal line of four of one's own discs.


The board size can be adjusted by changing values of `board_width` and `board_height` in program (default set to 4x6). Similarly, the PyGame window size can be adjusted by changing values of `window_width` and `window_height` (default set to 640x480).
Also feel free to pass on remarks and suggestions to increase the quality of the code.
Prerequisites
--------------
What things you need to run the program:
- Python Compiler (3.7 Recommended)
- Install **PyGame** from pypi by using the following commands:
```bash
pip install PyGame
```
How To Play
------------
- If you have the correct version of Python and Pygame installed, you can run the program in the command prompt / terminal.
``` bash
cd connect-4
python Connect4_Game.py
```
- Drag and drop coins at the column you want to make a move.
- Use the terminal window to view moments and other details.
**Note:** If you're using Python 3, replace the command "python" with "python3"