# Hex pipes ## What this builds A puzzle on a hex grid. Each tile is a pipe with a subset of its six edges open. A click rotates it 60 degrees. The level is solved when every open edge meets an open edge, and a stated source is connected to a stated sink. The art and the levels are original. Tests cover rotation, a known solved grid, and a known unsolved one. Read `spekkr.inputs.json` first. `title` labels the board. `size` is used by a fresh editor; shipped levels carry their own radius. `pack` chooses the levels. `flow` and `hints` change the chrome. ## Out of scope - A public level workshop in this version. - Network or a daily challenge server in the checks. - Square-grid pipes. This spec is hex only. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Rotation and edges - Edges are numbered 0 to 5, clockwise from east. - A rotate turns every open edge to `(e + 1) modulo 6`. Five more rotates return the start. - Two neighbouring tiles connect when each has the edge that faces the other open. Accept when: the rotation fixtures in `design.md` show the six orientations of a two-edge tile, and a neighbour pair is connected or not as listed. ### R2. Solved and unsolved - Level H1 is a radius-2 board whose documented solution (a list of orientations) is connected from source to sink and has no open edge facing an empty or a closed edge. - Level H0 is the same tiles at the starting orientations, and is not solved. - A connectivity check reports both results, and a search finds that H1's listed orientations are a solution. Accept when: H1 with the solution file is solved, H0 is not, and a single rotate from H1 on the centre tile makes it unsolved. ### R3. Frames and files - Screenshots: H0, H0 after one documented rotate, H1 solved, and H1 with `flow` on. - One command runs rotation, connectivity, and pack-load tests, and writes the frames. No network. Accept when: both packs load, every intro level has a shipped solution that the checker accepts, and the frames match the goldens. ### R4. Inputs - The build reads `spekkr.inputs.json`. Settings label the UI, options turn features on or off, and a swap must be one of its choices. - A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key. Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check. ## Verification Rotation mechanics and hex neighbour facing are unit-tested. A known solved grid is connected from source to sink; a known unsolved one is not. Every intro level ships a solution the checker accepts. A golden board screenshot is checked. 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 add a level, and how to run the checks.