This is a Python implementation of the color flood game.
The aim of the game is to fill (flood) the entire board with a single color in the minimum number of steps. In each step, the player selects a color from 6 colors to flood the board. The player iterates until all the cells in the board have a single color.
The flooding function implements the stack-based recursive (four-way) algorithm described here.
- Plotly Dash
- numpy
frontend.py
: Game front-end. Renders the game GUI in a browser using Dash. Theplay()
function holds the main game logic.backend.py
: Game back-end. Holds game logic.frontend_helper.py
: Includes helper functions for the front-end.colors.py
: Includes a set of variables for color definition.settings.py
: Includes game settings (e.g. grid size).
README.md
: This file. It contains information about the project.LICENSE.txt
: GNU GPL v3.0 License file.Demo/
: Includes a video demo and an animated GIF for demo and documentation purposes.
Exploration/
: Miscellaneous scripts I found useful while developing the program.
- Run the
frontend.py
script:C:\ProgramData\Anaconda3\python.exe frontend.py
- Once the Python prompt returns with
Running on http://127.0.0.1:8050/
, open the returned URL in the browser and start playing.
- Refactor the code (e.g. avoid global variables).
- Implement an automatic player using reinforcement learning.
- Implement a mechanism (API?) for others to plug-in their automatic player.
- Ahmad Al-Kashef: Initial implementation (v1.0).
This is an open source free program provided under Version 3 of the GNU GENERAL PUBLIC LICENSE. A copy of the license is available in LICENSE.txt at the root of the source code. If not, please see http://www.gnu.org/licenses/.