Checkers, against Hazel
Hazel activities › Hazel AI opponents · source on GitHub · hazeljs on npmYou play black, from the bottom, and move first; Hazel plays white. A piece moves one square diagonally forward. Jump over one of Hazel's pieces onto the empty square beyond to take it; when you can jump, you must, and you keep jumping while you can. A piece that reaches the far row is crowned a king (👑), and moves backward too. Whoever cannot move loses. Tap a piece, then where it goes. The moves, the jumps, the kings and Hazel's choice are a Hazel program, shown beside the board: Hazel tries every move, then your every answer, and so on, as many moves ahead as you choose.
This app needs JavaScript, and a page served over http (python3 -m http.server, then localhost).
The vocabulary the module sees (checkers/rules/preamble.hz). The listings are text, highlighted, until Edit in Hazel opens each in Hazel's own editor; an edit changes the next move.
loading preamble.hz…
(start, moves, apply, choose).loading Checkers.hz…
hazeljs-examples · versions · Apache 2.0 (code), CC BY 4.0 (words, the icon) · by Matthew Hammer · an example for hazeljs