As part of my efforts to learn to program in Haskell, I created the solitaire program that you see above. Playing the game is simple - just click and drag a card. Refresh the screen to start over. It seems to run best on a Chrome browser on a Linux machine. It will not work well on a touchscreen device ( but, I think, that could be fixed pretty easily).
The technologies involved are:
- Haskell - using the Haste compiler.
The card deck is a svg file. I used these beautiful SVG-cards designed by David Bellot. Thank you David Bellot. The code that handles the cards is all Typescript and deserves its own blog post. I’ll write that post before too long.
The d3.js library is used for manipulating the card deck and for handling events (mouse picks, drag, drop, etc).