Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/duetosymmetry/game-about-squares-solver-haskell
A Haskell solver for Game About Squares (gameaboutsquares.com)
https://github.com/duetosymmetry/game-about-squares-solver-haskell
game haskell solver
Last synced: 23 days ago
JSON representation
A Haskell solver for Game About Squares (gameaboutsquares.com)
- Host: GitHub
- URL: https://github.com/duetosymmetry/game-about-squares-solver-haskell
- Owner: duetosymmetry
- Created: 2014-08-09T13:48:37.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-25T04:02:23.000Z (over 9 years ago)
- Last Synced: 2023-05-15T00:40:17.923Z (over 1 year ago)
- Topics: game, haskell, solver
- Language: Haskell
- Size: 215 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Game about squares solver (Haskell)
===================================This is a pretty simple solver for Andrey Shevchuk's Game About
Squares, aka GAS (http://gameaboutsquares.com). As a challenge to
myself I wrote the solver in Haskell (where I have no
experience). Thanks to [@akeshet](https://github.com/akeshet) for getting me hooked on the game and
originally inspiring me to write a solver (after seeing his python
implementation). This solver does not do the fancy stuff that
[@zwegner](https://github.com/zwegner)/[game-about-squares-solver](https://github.com/zwegner/game-about-squares-solver) does (though thanks to his python
level data I did not have to input it all by hand).To compile: `ghc --make Levels`.
To run: `./Levels [original level number]`.
Or load interactively in `ghci`:
```
:load Levels
trySolveOrigLevelNum origLevelNum
-- or use the lower-level driver
let Just (board, initState) = origLevelByNumber 15
let (smap, moves) = trySolveLevel board initState maxDepth
putStr $ moveListStr' moves
```If you are a Haskell guru or know one, please let me know how this
code can be made more idiomatic/efficient/etc. Feedback welcome.Leo C. Stein