# Critter slide ## What this builds A grid puzzle. Hoppers move any number of empty squares like a rook, but only horizontally. Hoppers cannot pass a blocker. Hoppers want to reach a burrow of their own colour. Blockers move one square orthogonally, cannot enter a burrow, and are used to open or close paths. The rules are original. A level is a starting grid and a goal test: every hopper on a burrow of its colour. Read `spekkr.inputs.json` first. `title` labels the board. `size` is the default size for a fresh editor grid; shipped levels carry their own size. `pack` chooses the level set. `hints` and `undo` add controls. ## Out of scope - A public level workshop in the first version. - Animated 3D animals or sound beyond a single move pip. - Network, accounts or a leaderboard. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Movement - Hoppers (`H` and `h` for two colours) slide any number of clear squares along a row, never a column, and never through or onto a blocker (`B`) or another hopper. - Blockers move one clear orthogonal square, never onto a burrow (`O` or `o`) or another piece. - A move that would leave the board is illegal. Empty squares are `.`. Accept when: the movement fixtures in `design.md` each produce the stated legal set, and no illegal move is accepted. ### R2. A known solvable level - Level I1 in the intro pack is the 5 by 5 grid in `design.md`. - The documented seven-move solution reaches a solved state, and a solver check reports it solvable in at most 7 moves. Accept when: applying the seven moves leaves every hopper on its burrow, and a breadth-first search finds a solution of length 7 or less. ### R3. A known unsolvable position - Position U1 in `design.md` is not solvable: a hopper is boxed in with no path to its burrow, even with blocker help. - A search that expands every position up to 30 moves reports no solution, and the UI's give-up check agrees. Accept when: a search of U1 reports unsolvable, and a hopper move that would seem to help is illegal as in the table. ### R4. Levels and chrome - Each pack is a file of levels. A level has an id, a grid, and the documented solution length for solvable ones, or `unsolvable`. - If `hints` is on, a control highlights every piece that has at least one legal move. - If `undo` is on, each move can be stepped back in order, back to the start. Accept when: I1 loads from the file, hints highlight the two pieces named in `design.md` at the start, and undo after two moves restores the start. ### R5. Screenshots and files - Frames: `start` of I1, `mid-solve` after three documented moves, `solved` after seven, `blocked` of U1. - One command runs movement tests, the solvability checks, and writes the screenshots. Accept when: the command passes for both packs, and the frames match within the tolerance in `design.md`. ## Verification Unit tests cover hopper and blocker movement, including illegal moves off the board and through blockers. The documented I1 solution solves the level; a search agrees it is solvable in at most 7 moves. Position U1 is reported unsolvable. Golden frames are taken for a short solve and for the blocked position. No physical pieces and no network. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to play, how to run the checks, and how to add a level.