Minesweeper, swept by Hazel's rules
Hazel activities › one-player games · source on GitHub · hazeljs on npmOpen every cell that hides no mine. A number says how many of the cell's eight neighbours are mines. Tap to open; flag a mine with a right click, a long press, or 🚩 mode; tap a number whose mines are all flagged to open the rest around it. The first tap is always safe. The mines, the counts, the opening and the flags are a Hazel program, shown beside the board.
This app needs JavaScript, and a page served over http (python3 -m http.server, then localhost).
The vocabulary every module sees (minesweeper/rules/preamble.hz). The listings are text, highlighted, until Edit in Hazel opens each in Hazel's own editor; an edit changes the next tap.
loading preamble.hz…
loading Board.hz…
(fresh, lay, reveal, flag, chord, flags).loading Play.hz…
sure.loading Hint.hz…
pick.loading Guess.hz…
hazeljs-examples · versions · Apache 2.0 (code), CC BY 4.0 (words, the icon) · by Matthew Hammer · an example for hazeljs