/connectfour

Python Connect Four, with React/Redux/Websockets

Primary LanguageJavaScript

Connect Four

While inspired by Connect Four, this game accommodates other numbers (Connect Three, Six, etc.), as well as variable board dimensions and a variable number of players.

Code

The game logic is in Python.

Python version is listed in runtime.txt.

Package dependencies are listed in requirements.txt. To install (preferably in a new virtualenv):

pip install -r requirements.txt

Web app

The goal of the web app was to use as many "hip" technologies as I could cram into one project:

To install JS dev dependencies (listed in package.json):

npm install

If you install any new JS dev dependencies, use the --save-dev option to list in package.json:

npm install <package-name> --save-dev

To bundle JS and CSS for the web (configured in webpack.config.js):

webpack

To automate the above while developing:

webpack --watch

To launch the web app:

./run_web.py

GUI app

The GUI view uses Python's built-in Tkinter library.

To launch:

./run_gui.py

Command line app

To start the command line app (from root dir):

./run_cli.py

Tests

To run all unit tests (from root dir):

python -m unittest discover -v