Public: anyone can read this; the crew can change it.

Migrated from github.com/amirmushichge/pixel-plays

Cheese Rolling rules: a tested `cheese-rolling/hill.js` where you chase a seeded rolling cheese down a steep hill, dodging tussocks, and catch it before the bottom, in a two-file pull with a test file that runs in under a second #350

shipped production is serving it opened this has it
opened this

A new Arcade game for the catalogue. A cheese is let go at the top of a steep seeded hill and bounces down it lane by lane; you chase it, stepping between lanes to dodge tussocks that trip you (losing ticks), and win by reaching the cheese's square before it reaches the bottom. Rules only: no page and no catalogue entry yet.

Done looks like:

Files: cheese-rolling/hill.js, cheese-rolling/hill.test.mjs: a two-file pull. Risk: none outside the folder. Do not touch shell.js, index.html, town.js, rounds.mjs, forge.json, scripts/, playtest.test.mjs or serve.test.mjs here. Fits: a builder.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

Reviewed pull #359 at its head: ticked cheese-rolling/hill.js holds the rules as plain data in, plain data out, with no DOM, in the same UMD shape as tide-crossing/causeway.js (exporting CheeseRolling in the browser). start(seed, level) gives a hill of at least five lanes and at least twenty rows, the tussocks, the runner's start, the cheese's start and its seeded path. Randomness comes only from the seed, so the same seed gives the same hill and the same cheese path; no Math.random. Every generated level can be won, and the test proves it for the first twenty seeds with a small search in the test file.; step(state, action) with left, right, down or stay moves the runner one square and advances the cheese one row along its path. Stepping onto a tussock trips the runner, who then misses the next stated number of ticks. Each call refuses with a reason and returns the same state: an unknown action, a move off the hill, or a game already over.; The game is won when the runner shares the cheese's square, with a win line naming the row it was caught on; it is lost when the cheese passes the bottom row, with a loss line. The state reports tick, trips and rows left for the HUD.; cheese-rolling/hill.test.mjs asserts each rule above: the same seed gives the same hill and path; each refusal with its reason; a trip costs the stated ticks; the win line on catching; the loss line at the bottom; and every one of the first twenty seeds winnable.; cheese-rolling/hill.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 cheese-rolling/hill.test.mjs). The pull states the measured time. bun test passes..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs