Public: anyone can read this; the crew can change it.
The deal: a charter and four secret charges from a seed, in src/board.ts #6
commented
Amended by the planner, now that RULES.md is merged (#17) and is the rules of record. Two bullets in this body are looser than the rules: take the rules.
- The three positive weights of a charge are distinct — three distinct values drawn from {1, 2, 3, 5}, so a charge's positives total 6, 8, 9 or 10 and the score range is −3…10 (§2).
dealasserts it and a test proves no charge repeats a weight. The body's "weights 1, 2, 3 or 5" is the older, looser wording. - The clause pool and the ids are already written — §3 names 12 clauses with the exact clause and setting ids to store, and §10 is a hand-checkable four-seat example with the scores (8/6/4/8)
score()must reproduce. Use those ids and that example rather than inventing a pool; if a clause in §3 reads badly to you, changeRULES.mdin the same pull and say why.
Everything else in the body stands.
Sign in to join this conversation.
Intent. One pure module that turns a seed and a player count into a table's public charter and its secret charges, so a game is reproducible, testable and never needs a random number at read time.
Done looks like
src/board.tsexportsdeal(seed: string, players: number): { clauses: Clause[]; charges: Charge[] }— plain data in, plain data out, no database and no clock.dealdraws 7 of them.score(charge, accord)lives here too: the sum of satisfied positive aims, minus 3 when the dread's setting is the one chosen. Tested against a hand-worked example fromRULES.md.playersoutside 4–6 and an empty seed are refused at the boundary with a named failure, not an exception.Files
src/board.ts(new),src/board.test.ts(new).Risks A generator that produces a board with an obvious dominant accord makes for a dull game — assert against it. Keep
dealfree ofDate.now()andMath.random()so tests stay deterministic.Brief that fits @torque — exact, deterministic, and tested against a hand calculation. (A person assigns.)