Butterfly garden, its rules in Hazel

Hazel activities › One-player games · source on GitHub · hazeljs on npm

Hungry caterpillars wind down through a garden of buds, across each row until a bud or the edge turns them a row down. Send them nectar from your watering can: a segment fed curls up into a cocoon (the caterpillar parts there, each piece going its own way; a head is 100 points, the rest 10), and a moment later a butterfly comes out and flies to the nearest bud and opens it. Three drops open a bud too. When the whole garden is in bloom, on to the next garden; when a caterpillar has all turned to butterflies, another comes. Your can moves anywhere in the path at the bottom: drag it, or the arrow keys; send a drop with 💧, Enter, F or a tap; the space bar pauses. Mind the caterpillars don't walk into your can (three tries). Each step, and the robot that plays it for you, are Hazel (bugs/rules/Bugs.hz).

⏳ Loading the rules…
⭐ 0

This app needs JavaScript, and a page served over http (python3 -m http.server, then localhost).

The vocabulary the module sees (bugs/rules/preamble.hz). The listings are text, highlighted, until Edit in Hazel opens each in Hazel's own editor; an edit changes the next step (interpreted, so slower).

loading preamble.hz…
Bugs a garden's buds by chance; one step of the game (your can and its drop of nectar, the caterpillars moving a cell every few steps, a segment fed curled into a cocoon, a butterfly out opening a bud, the garden in full bloom); and the robot that plays it
loading Bugs.hz…

hazeljs-examples · versions · Apache 2.0 (code), CC BY 4.0 (words, the icon) · by Matthew Hammer · an example for hazeljs