Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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)

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