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

Migrated from github.com/amirmushichge/pixel-plays

Mill Race rules: a tested `mill-race/race.js` that turns pipe tiles to carry the stream to the water wheel, from plain data #174

shipped production is serving it opened this has it
opened this

A new Puzzle game for the catalogue: a mill stream enters one edge of a grid of channel tiles; turn the tiles until water runs unbroken from the sluice to the water wheel. Rules only: no page and no catalogue entry yet.

Done looks like:

  • [ ] mill-race/race.js holds the rules as plain data in, plain data out, with no DOM. start(seed, level) lays out a stated grid of straight, bend, tee and blank tiles with a sluice on one edge and the wheel on another; the same seed and level always give the same grid, and every grid can be solved (build it by laying a connected path first, then turning each tile a seeded number of quarter turns).
  • [ ] turn(state, x, y) rotates one tile a quarter turn clockwise and counts one move; a turn on a blank tile, or off the grid, is refused. flow(state) returns the cells the water reaches from the sluice; when it reaches the wheel the level is cleared and the next, larger level starts, up to a stated last level.
  • [ ] Each level has a stated par of moves; the end reports levels cleared and moves over par, with a win line at or under a stated total over par and a loss line otherwise.
  • [ ] mill-race/race.test.mjs asserts each rule above: the same seed giving the same grid, every generated level being solvable by undoing its turns, a refused turn, a quarter turn changing which neighbours connect, flow stopping at a break and reaching the wheel when joined, the level advancing, and the win and loss lines.
  • [ ] bun test passes for the new file.

Files: mill-race/race.js, mill-race/race.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