NisargMukeshbhaiPatel / Connect-Four-Terminal-Game

A classic Connect Four game implemented in Python, playable in the terminal with colorful text-based graphics.
2 stars 1 forks source link

Connect Four

Connect Four is a classic two-player game in which the players take turns dropping colored discs into a grid. 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.

Gameplay Clip

cf

Installation

NOTE: Use a Python version < 3.12 if you're on Windows, as there is an issue with the windows-curses module. See windows-curses issue#48

  1. Clone & Install dependencies:

    git clone https://github.com/NisargMukeshbhaiPatel/Connect-Four-Terminal-Game.git
    cd Connect-Four-Terminal-Game/Implementation
    pip install -r requirements.txt
  2. Run Code:

    python main.py  

Building Executable

An Example build for Windows x86_64 is already provided for reference

Follow these steps to build a single executable file

pip install pyinstaller
cd Implementation
pyinstaller --onefile main.py

Copy the assets/ folder to the dist/ so executable can access assets

Find your build file inside the dist/ folder and run it

Troubleshooting

If you encounter issues with pyinstaller or pip not being found, try the following:

python -m pip install pyinstaller
python -m PyInstaller --onefile main.py 
# OR
py -m pip install pyinstaller
py -m PyInstaller --onefile main.py