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
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
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.jsholds 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 withtick(state, dt).hedge-maze/maze.test.mjsasserts 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 testpasses for the new file.Files:
hedge-maze/maze.js,hedge-maze/maze.test.mjs. Risk: none outside the folder. Do not touchshell.js,index.html,town.jsorrounds.mjshere. Fits: a builder.