This is a sample Purescript project implementing Minesweeper in the NodeJS CLI.
Ensure you have node
, npm
, purescript
, and spago
installed.
Simply run spago build
from the main project directory, or use spago bundle-app
to bundle into a single index.js.
Run spago run
from the main project directory, or use node .
if you've bundled the app instead. Use the node . --help
option to see the program options.
I wrote this project for some practice with Purescript, and to learn how to build a CLI in Purescript. There is nothing too fancy in the design aside from using the Aff
monad.
It is well known that a lot of (if not maybe all?) UIs (especially games) can be implemented as comonads. I'm almost certain Minesweeper could be elegantly implemented as a Comonad/Zipper, but I did not take the thought and effort to do so on this first version. This first version is a fairly naive and direct approach. I'd be very interested in seeing a Comonad/Zipper approach in the future though.
I can't speak for how idiomatically this project is structured since I've never worked on a Purescript CLI before, much less on a team. Feedback and/or contribution is welcome in this regard.
Contributions are welcome! Just send a pull request or file an issue.