# Elevator toy ## What this builds A side-on view of several elevator shafts. Cabins have mass, cables, and a motor that accelerates up to a speed cap. They must not occupy the same shaft segment. A run is a sequence of call-button presses and cabin commands, and with a fixed seed it is deterministic. This is an original toy, not a copy of another playground. Read `spekkr.inputs.json` first. `shafts` and `floors` size the building. `seed` fixes any passenger spawn. `passengers` and `cables` change what is drawn. `units` only change labels; the numbers in `design.md` are in metres and seconds and always hold. ## Out of scope - A real building controller, safety certification, or hardware. - Network or a multiplayer lobby. - A story mode longer than a single building. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. The building - Shafts are 2.4 m wide and 0.4 m apart. Each floor is 3.2 m high, with a 0.2 m slab. - A cabin is 2.2 m wide and 2.8 m high, mass 800 kg, max speed 4 m/s, max acceleration 1.5 m/s². - The origin is the floor of the ground storey, at the left of shaft 0. Time is in seconds, stepped at 1/60 s. Accept when: the default building's bounding numbers match `design.md`, and a cabin at rest on floor 0 has its floor at z = 0.05 m (the sill). ### R2. Motion - A command to a floor accelerates, cruises, and decelerates so the cabin stops at that floor's sill, within 0.01 m, with speed 0. - The motion is the trapezoid in `design.md`. There is no bounce. - The same commands and the same seed produce the same position at every step, bit-identical in the recorded trail. Accept when: the fixture run in `design.md` has the cabin positions listed at t = 1, 2, 4 and 8 seconds, each within 0.01 m, and a second run hashes to the same trail. ### R3. Collisions and doors - Two cabins in the same shaft may not overlap. A command that would cause an overlap is refused, and the cabin already moving keeps its plan. - Doors may be open only when speed is 0 and the cabin floor is within 0.01 m of a sill. A passenger may enter only through an open door. - A cabin with `passengers` off never spawns people; the physics of empty cabins still holds. Accept when: the near-miss fixture stops the second cabin one floor short, and a door-open at speed 0.1 m/s is refused. ### R4. Recording - One command writes a headless recording: a JSON trail of cabin positions each step, and a 5-second frame sequence at 30 frames a second for the fixture run. - Screenshots `idle-shafts`, `two-moving`, `near-miss` and `all-parked` are frames from that sequence at the times in `design.md`. Accept when: the frames match the goldens within the tolerance, and the JSON trail matches the fixture positions. ### R5. Files - The build has no network. Units only change labels. Accept when: the command passes for 2 shafts and for 5, and for both unit labels. ## Verification A deterministic run with a fixed seed reaches the cabin positions in the fixture trail. Collision and door-timing tests cover the near-miss and a door opening at speed. A short headless recording is written and the four frames are checked against goldens. No hardware 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 replay a seed, and how to run the checks.