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
Sign in to join this conversation.
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.jsholds 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.lily-pond/pond.test.mjsasserts 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 testpasses for the new file.Files:
lily-pond/pond.js,lily-pond/pond.test.mjs. Risk: none outside the folder. Do not touchshell.js,index.html,town.jsorrounds.mjshere. Fits: a builder.