Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
Pigeon Post rules: a tested `pigeon-post/loft.js` that sends pigeons to villages in a sequence and asks you to send them again in order, from plain data, with a test file that runs in under a second #238
Reviewed pull #254 at its head: ticked pigeon-post/loft.js holds the rules as plain data in, plain data out, with no DOM. start(seed) gives a stated set of villages and a seeded route of village ids; the same seed always gives the same route. Round one shows a stated starting length.; A completed route scores a stated amount per pigeon and grows the route by one for the next round. The game ends on a wrong send or after a stated last round, with a win line on finishing every round and a loss line otherwise, reporting the longest route sent.; pigeon-post/loft.test.mjs asserts each rule above: the same seed giving the same route, the show phase refusing sends, the pace quickening and flooring, a right and a wrong send, the route growing, and the win and loss lines.; bun test passes for the new file.; pigeon-post/loft.test.mjs loads no page and starts no renderer or server: it calls the rules module directly and runs in under one second on its own (bun test pigeon-post/loft.test.mjs). The pull states the measured time.; If the check fails only on "test took longer than 600s" or a CPU limit, the pull says so and names #227. Do not cut the rules or their tests to get under the limit..
Left open after pull #254 landed: 1 unticked item remains (showing(state) reports the step being shown and the phase (show or send); tick(state, dt) advances the show at a stated pace that quickens a stated step each round down to a stated floor. send(state, village) is refused during show; during send it accepts the next village of the route and a wrong village ends the game.). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.
Already done on main in 77b9861: showing(state) reports { phase, step, village }, tick advances at pace(round) = max(0.6, 1 - 0.1·(round-1)), send is refused with show during the show, and a wrong village ends the game with event lost. Each is asserted in pigeon-post/loft.test.mjs (tests at lines 30, 42, 55, 74).
A new Memory game for the catalogue: a loft shows pigeons flying out to villages one after another, then you send the same pigeons to the same villages in the same order; each round the route grows by one. Rules only: no page and no catalogue entry yet.
Done looks like:
pigeon-post/loft.jsholds the rules as plain data in, plain data out, with no DOM.start(seed)gives a stated set of villages and a seeded route of village ids; the same seed always gives the same route. Round one shows a stated starting length.showing(state)reports the step being shown and the phase (showorsend);tick(state, dt)advances the show at a stated pace that quickens a stated step each round down to a stated floor.send(state, village)is refused duringshow; duringsendit accepts the next village of the route and a wrong village ends the game.pigeon-post/loft.test.mjsasserts each rule above: the same seed giving the same route, the show phase refusing sends, the pace quickening and flooring, a right and a wrong send, the route growing, and the win and loss lines.bun testpasses for the new file.Files:
pigeon-post/loft.js,pigeon-post/loft.test.mjs. Risk: none outside the folder. Do not touchshell.js,index.html,town.jsorrounds.mjshere. Fits: a builder.Why this is rewritten: the first try (pull #222) went red only because the whole suite passed the deploy's 600 s limit while other checks ran at the same time, not because of a bug in the rules. #227 (pull #233) makes the suite cheaper. Done also looks like:
pigeon-post/loft.test.mjsloads no page and starts no renderer or server: it calls the rules module directly and runs in under one second on its own (bun test pigeon-post/loft.test.mjs). The pull states the measured time.