Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
Chestnut Roast rules: a tested `chestnut-roast/pan.js` where you catch roasted chestnuts in a paper cone and dodge the burnt ones, from plain data, in a two-file pull with a test file that runs in under a second #277
Reviewed pull #305 at its head: ticked chestnut-roast/pan.js holds the rules as plain data in, plain data out, with no DOM. start(seed) gives a pan, a cone at a stated position and width, and a seeded schedule of pops, each with a launch time, a speed, an angle and a kind (roasted or burnt). Randomness comes only from the seed, so the same seed and inputs give the same game; no timers and no Math.random. A chestnut's position is a closed-form function of time since its launch, so where it lands does not depend on how time is sliced.; tick(state, dt) advances time and lands every chestnut that reaches the pavement; dt must be a finite number above 0. move(state, x) sets the cone's target, clamped to the pavement, and the cone travels toward it at a stated top speed. A roasted chestnut landing in the cone scores a stated amount; a burnt one in the cone costs a stated life; a roasted one missed breaks the catch streak.; Every stated number of catches the pops come faster by a stated step, down to a stated floor. Losing every life ends the game with a loss line; catching a stated total ends it with a win line reporting score and best streak.; chestnut-roast/pan.test.mjs asserts each rule above: the same seed giving the same pops, the landing point the same however time is sliced, the cone's clamp and top speed, a catch, a burnt catch costing a life, a miss breaking the streak, the quickening and its floor, the loss line and the win line.; bun test passes for the new file.; chestnut-roast/pan.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 chestnut-roast/pan.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. Do not cut the rules or their tests to get under the limit..
A new Catching game for the catalogue: chestnuts pop out of a street vendor's roasting pan in arcs, and you move a paper cone along the pavement to catch the roasted ones while letting the burnt ones fall. Rules only: no page and no catalogue entry yet.
Done looks like:
chestnut-roast/pan.jsholds the rules as plain data in, plain data out, with no DOM.start(seed)gives a pan, a cone at a stated position and width, and a seeded schedule of pops, each with a launch time, a speed, an angle and a kind (roastedorburnt). Randomness comes only from the seed, so the same seed and inputs give the same game; no timers and no Math.random. A chestnut's position is a closed-form function of time since its launch, so where it lands does not depend on how time is sliced.tick(state, dt)advances time and lands every chestnut that reaches the pavement; dt must be a finite number above 0.move(state, x)sets the cone's target, clamped to the pavement, and the cone travels toward it at a stated top speed. A roasted chestnut landing in the cone scores a stated amount; a burnt one in the cone costs a stated life; a roasted one missed breaks the catch streak.chestnut-roast/pan.test.mjsasserts each rule above: the same seed giving the same pops, the landing point the same however time is sliced, the cone's clamp and top speed, a catch, a burnt catch costing a life, a miss breaking the streak, the quickening and its floor, the loss line and the win line.bun testpasses for the new file.chestnut-roast/pan.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 chestnut-roast/pan.test.mjs). The pull states the measured time.Files:
chestnut-roast/pan.js,chestnut-roast/pan.test.mjs: a two-file pull. Risk: none outside the folder. Do not touchshell.js,index.html,town.js,rounds.mjs,forge.json,scripts/,playtest.test.mjsorserve.test.mjshere. Fits: a builder.