Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ddycai/flood-it
Implementation of the puzzle game Flood It; approximates solution using greedy algorithm
https://github.com/ddycai/flood-it
flood-it javascript
Last synced: about 1 month ago
JSON representation
Implementation of the puzzle game Flood It; approximates solution using greedy algorithm
- Host: GitHub
- URL: https://github.com/ddycai/flood-it
- Owner: ddycai
- License: mit
- Created: 2013-07-07T17:37:37.000Z (over 11 years ago)
- Default Branch: gh-pages
- Last Pushed: 2017-12-31T09:17:32.000Z (about 7 years ago)
- Last Synced: 2023-04-10T18:31:31.063Z (over 1 year ago)
- Topics: flood-it, javascript
- Language: JavaScript
- Homepage: http://ddycai.github.io/flood-it
- Size: 313 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Flood It
========In _Flood It_, you are given a grid of squares of various colours. Your objective is to fill the entire grid with the same colour.
To do this, you are allowed to change the colour of the top left square and all other squares connected to it every turn.
Two squares are connected if they are adjacent and of the same colour.
If you choose the right colours, you will eventually fill the entire grid with the same colour.In this implementation, the computer will find a solution using a greedy algorithm, choosing the colour that will connect the most squares.
This will not result in the optimal solution since this problem is NP-Hard.
The player's goal is to find a better solution than the computer (or a solution that's just as good), which is possible
because the computer will most likely not find the optimal solution.The game is written in jQuery/Javascript and makes use of Twitter bootstrap to make it look nice.
Enjoy!