Solitaire, played by Hazel's rules
Hazel activities › one-player games · source on GitHub · hazeljs on npmKlondike: build the four foundations, each suit from the Ace up to the King. Tap a card to move it where it fits, or drag it; tap the stock to turn cards over. The deal, every legal move and the win are a Hazel program, shown beside the game, and the page asks it before every move.
This app needs JavaScript, and a page served over http (python3 -m http.server, then localhost).
The vocabulary every module sees (solitaire/rules/preamble.hz). The listings are text, highlighted, until Edit in Hazel opens each in Hazel's own editor; an edit changes how the next move is judged.
loading preamble.hz…
loading Cards.hz…
loading Deal.hz…
(deal, moves, moves_from, apply, won).loading Moves.hz…
hazeljs-examples · versions · Apache 2.0 (code), CC BY 4.0 (words, the card back) · the card faces are Adrian Kennard's, CC0 (about them) · by Matthew Hammer · an example for hazeljs