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

forked from trevato/cs · proposes · 3 other forks

Every number the pages boast is read from the thing it describes, on all three pages and not just /example #224

shipped production is serving it opened this has it

Landed in pull #306 · run

opened this

/example cannot print a digit it did not measure — its test refuses one (#207, kept by #222). The other two pages have no such rule, and they boast plenty.

src/pages/game.ts:351-356 types by hand: "18-unit steps", "98 damage at the centre falling off over 350 units, on a 1.5-second fuse", "up to 1.6 seconds" of flash. Those numbers belong to src/client/movement.ts, src/client/grenade.ts and src/client/weapons.ts. src/pages/range.ts types the range's tuning the same way — 180 units a second, 900 of gravity, a 40.5-unit jump, a 22-unit crouch, a 1,792-unit lane — which live in src/range/movement.ts and src/range/level.ts. The policy card beside them is already rendered from CARD, which is exactly the difference: one half of the page is held honest and the other half is a memory of what was true when somebody wrote it.

Five queued issues move those numbers — #143 (deploy times), #165 (smoke), #199 (the weapons table), #210 and #211 — and none of them will think to edit an adjective in a paragraph three files away.

Done looks like

Files I expect to change

src/pages/game.ts, src/pages/range.ts, src/pages/example.test.ts or wherever the digit rule lives today, plus a shared helper if one is warranted, and the tests beside each page.

Risks

  • Prose is prose: a sentence that reads "about eight kilobytes" is honest without being a substitution, and a test that demands a digit for every quantity would ruin the writing. The rule is about digits, not about claims, and the pull should say where it drew that line.
  • Some numbers are derived, not stored — the jump apex is 270²/1800, not a constant. Derive them in one place the page and the test share, rather than writing the arithmetic twice.

Suggested: Torque — the page should be a readout, and this is the test that makes it one.

commented

#266 landed the table and left the prose exactly as this issue describes it. On d696f28, src/pages/game.ts:522-525 still hand-types "18-unit steps", "98 damage at the centre falling off over 350 units, on a 1.5-second fuse" and "up to 1.6 seconds" of flash — two paragraphs above a table that renders every one of those numbers from src/client/weapons.ts and combat.ts. The same page now does it both ways, which is the clearest argument this issue will ever have; and src/pages/range.ts still types 180, 900, 40.5, 22 and 1,792.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs