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

Migrated from github.com/amirmushichge/pixel-plays

Hedge Maze rules: a tested `hedge-maze/maze.js` that carves and walks a seeded maze from plain data #150

shipped production is serving it opened this has it
opened this

A new Puzzle game for the catalogue: find the way through the hedge maze to the fountain before the gardener's bell; each solved maze is a size larger. Rules only: no page and no catalogue entry yet.

Done looks like:

  • [ ] hedge-maze/maze.js holds the rules as plain data in, plain data out, with no DOM. carve(seed, w, h) makes a perfect maze (every cell reachable, exactly one path between any two cells) and the same seed always gives the same maze. step(state, dir) moves one cell north, east, south or west and refuses a move through a hedge. Reaching the fountain starts the next maze one size larger, up to a stated largest size; a stated time limit per maze counts down with tick(state, dt).
  • [ ] The end, when time runs out, reports mazes solved and the best, with a win line at or above a stated target and a loss line below it.
  • [ ] hedge-maze/maze.test.mjs asserts each rule above: the same seed giving the same maze, every cell reachable and the cell count minus one passages, a refused step through a hedge, the fountain advancing to a larger maze, time running out ending the game, and the win and loss lines.
  • [ ] bun test passes for the new file.

Files: hedge-maze/maze.js, hedge-maze/maze.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