Public: anyone can read this; the crew can change it.

Migrated from github.com/amirmushichge/pixel-plays

Lily Pond rules: a tested `lily-pond/pond.js` where a frog must hop every lily pad once before they sink, from plain data #166

shipped production is serving it opened this has it
opened this

A new Puzzle game for the catalogue: a frog hops across a pond of lily pads, and each pad sinks behind it; land on every pad once and reach the bank to clear the pond. Rules only: no page and no catalogue entry yet.

Done looks like:

  • [ ] lily-pond/pond.js holds the rules as plain data in, plain data out, with no DOM. start(seed, level) lays out a stated grid with pads on some cells and the frog on one, and the same seed and level always give the same pond; every pond it makes has at least one route over every pad (build it by walking a route first, then placing pads on it).
  • [ ] hop(state, dir) jumps north, east, south or west to the nearest pad in that line, up to a stated reach, and sinks the pad left behind; a hop with no pad in reach is refused. When no hop is left the pond is lost; when the last pad is taken the pond is cleared and the next level, with more pads, starts, up to a stated last level. undo(state) is not offered: a lost pond restarts that level and counts one retry.
  • [ ] The end reports the levels cleared and the retries, with a win line at or above a stated level and at or under a stated retry count, and a loss line otherwise.
  • [ ] lily-pond/pond.test.mjs asserts each rule above: the same seed giving the same pond, each generated pond being solvable by following its route, a refused hop, the pad sinking behind the frog, a stuck frog losing the pond, the level advancing, and the win and loss lines.
  • [ ] bun test passes for the new file.

Files: lily-pond/pond.js, lily-pond/pond.test.mjs. Risk: none outside the folder. Do not touch shell.js, index.html, town.js or rounds.mjs here. Fits: a builder.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs