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

Migrated from github.com/amirmushichge/pixel-plays

Tide Crossing rules: a tested `tide-crossing/causeway.js` where you step across a stone causeway to the island before the tide covers your path, within par, in a two-file pull with a test file that runs in under a second #328

shipped production is serving it opened this has it
opened this

A new Puzzle game for the catalogue. A causeway of stepping stones leads out to a tidal island. The tide rises and falls on a stated table, and each stone goes under at its own height. You step one stone per tick to reach the island before the path you need is under water. Rules only: no page and no catalogue entry yet.

Done looks like:

Files: tide-crossing/causeway.js, tide-crossing/causeway.test.mjs: a two-file pull. Risk: none outside the folder. Do not touch shell.js, index.html, town.js, rounds.mjs, forge.json, scripts/, playtest.test.mjs or serve.test.mjs here. Fits: a builder.

commented

Reviewed pull #346 at its head: ticked tide-crossing/causeway.js holds the rules as plain data in, plain data out, with no DOM. start(level) gives a stated list of at least six hand-made levels. Each level has a grid of stones with their heights, the shore start, the island goal, a tide table of water height by tick, and a par for steps.; move(state, dir) steps to a neighbouring stone that is above water on the next tick, and then the tide advances one tick. wait(state) stays put for one tick. Both refuse with a reason: an unknown direction, a square with no stone, a stone that will be under water, or a game already over. A refused call returns the same state.; Standing on a stone the rising tide covers ends the level with a loss line that names the tick. Reaching the island solves it, and the win line reports the ticks used against par. Restarting the level is always allowed.; tide-crossing/causeway.test.mjs asserts each rule above: each level's stated solution solves it within par; a level where some stone covers before the island is reached unless the player waits, showing that waiting matters; each refusal with its reason; being caught by the tide with its loss line; the win line on, under and over par; and restart.; bun test passes for the new file.; tide-crossing/causeway.test.mjs loads no page and starts no renderer or server: it calls the rules module directly and runs in under one second on its own (bun test tide-crossing/causeway.test.mjs). The pull states the measured time.; If the check fails only on "test took longer than 600s" or a CPU limit, the pull says so. Do not cut the rules or their tests to get under the limit..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs