Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
Dinghy Race rules: a tested `dinghy-race/dinghy.js` that plays a whole game from plain data #109
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
The rules for Dinghy Race as a module on its own, so the game can be built on rules already proven, without touching any shared file. This is the first half of #92; the page and the listing follow in the issue that waits for this one.
Done looks like:
dinghy-race/dinghy.jstakes plain data in and returns plain data out (no DOM, no canvas, no timers, noMath.random: randomness comes from a seed passed in), loadable both by a<script>tag (aswindowglobal, like the other games' rules) and byimportin tests, following the pattern of an existing forged game's rules file such assoapbox-derby/.dinghy-race/dinghy.test.mjsasserts the best angle, the fall-off either side, head-to-wind stopping dead, the seeded wind shift per buoy, and a scripted trim that beats the rivals and one that loses. Each test would fail without the rule it names.bun test dinghy-race/passes and so doesbun test.index.htmlindinghy-race/yet (that would makeplaytest.test.mjsrequire a round before the page exists), and no change toshell.js,index.html,README.md,serve.test.mjs,rounds.mjsorog/.Files:
dinghy-race/dinghy.js,dinghy-race/dinghy.test.mjs. Risk: none shared, since both files are new. The rules must expose the state the playtest will read (phase, score, over, outcome line) so the page issue can script a round without reaching into drawing code. Fits: a builder.