r/purescript • u/sharkdp • Oct 28 '15
Parachuting robots: Interactive version of a classic puzzle (using Thermite and monadic parsers)
http://david-peter.de/parachuting-robots/
4
Upvotes
r/purescript • u/sharkdp • Oct 28 '15
3
u/paf31 Oct 28 '15
This is really nice and the code is very easy to read.
You might be able to improve parse error messages since the language is so static. An "unknown instruction X" error might be nice to have, for example, instead of "Could not match character".
I wonder if you could add "levels" by varying the instruction set, adding obstacles etc. Another nice variant might be a single robot on various 2d maps, with some objective like picking up an object.
1
u/sharkdp Oct 28 '15
This is my first project using the Thermite library. I really liked it, although I am still learning (and happy for code suggestions). I am also new to monadic parsers and still 'delighted' by their elegance. I hope this might be of interest for some people looking for example projects. The puzzle itself is also fun, if you have never seen it :-)
Souce code on Github.
1
u/dotneter Oct 28 '15
Is there a better solution?