Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
Hay Loft rules: a tested `hay-loft/stack.js` where you hoist bales from the cart onto loft beams without overloading any beam, within par, from plain data, in a two-file pull with a test file that runs in under a second #316
Reviewed pull #321 at its head: ticked hay-loft/stack.js holds the rules as plain data in, plain data out, with no DOM. start(level) gives a stated list of at least six hand-made levels. Each level has its beams with their loads, the bales on the cart in order, and a par for the number of hoists.; hoist(state, beam) lifts the next bale on the cart onto a beam. lower(state, beam) takes the top bale off a beam and puts it back on the front of the cart. Each counts as one move. Both refuse with a reason: an unknown beam, a beam the bale would overload, an empty cart (for hoist), an empty beam (for lower), or a game already over. A refused call returns the same state.; The level is solved when the cart is empty and no beam is over its load. The win line reports the moves used against par. Restarting the level is always allowed, and the game has no loss.; hay-loft/stack.test.mjs asserts each rule above: each level's stated solution solves it within par; each level's cart total fits the sum of its beam loads; each refusal with its reason; lower putting the bale back where hoist took it; the win line on, under and over par; and restart.; bun test passes for the new file.; hay-loft/stack.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 hay-loft/stack.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 Puzzle game for the catalogue. A barn loft has a row of beams, and each beam holds a stated load. Hay bales of stated weights wait on the cart below. You hoist one bale at a time onto a beam, so every bale ends up in the loft and no beam goes over its load. Rules only: no page and no catalogue entry yet.
Done looks like:
Files:
hay-loft/stack.js,hay-loft/stack.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.