Rules v0.8: rounds of alternating commands; sim updates

Rules (rules.md, new file):
- Rounds of 2 commands per player in snake order (A B B A, then B A A B).
  A command is one advance or one attack; each Avatar acts once per round.
- Flat 4 RAM captures, first row Lv 1, A2-C2 and C2-E2 lines cut,
  45-card decks, Code Zero at 3 Cores with Patient Zero at 1+ counters.

Simulator:
- Command rule (default on): commands.perPlayer, commands.leads,
  commands.snake; commands.on=false restores whole turns.
- Greedy bot values Avatar unlocks (unlockPoints) and picks one action
  per command.
- Prototype switches, off by default: Avatars in the deck (recruit.*),
  buying Avatars (buyAvatars.*), copy limits (copies.*), turn-1 draw and
  second-player draw options.
- cards.csv card-text revisions, with scripts and tests to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-09-28 14:07:45 -04:00
parent 6382de19c9
commit a3eb6850ee
21 changed files with 1089 additions and 96 deletions

View file

@ -29,12 +29,17 @@ const USAGE = `Files TCG simulator
--seed N first game's seed; game i uses seed + i (default 1)
--south BOT South's bot (default greedy)
--north BOT North's bot (default greedy)
--max-turns N player turns before a draw (default ${DEFAULT_RULES.maxTurns})
--max-turns N rounds × 2 before a draw (default ${DEFAULT_RULES.maxTurns}, i.e. ${DEFAULT_RULES.maxTurns / 2} rounds)
--rule K=V change a rule in src/rules.ts; repeatable. Examples: winLocations=9,
levelRam=4,4,6,8,10, startingAvatars=4, firstTurn.advance=false,
levelRam=4,4,6,8,10, startingAvatars=4, firstTurn.draw=true, firstTurn.advance=false,
firstTurn.captureRam=false, firstTurn.unlock=false, firstTurn.cards=false,
secondPlayer.ram=4, secondPlayer.avatars=1, secondPlayer.cards=2,
secondPlayer.locations=1
secondPlayer.ram=4, secondPlayer.avatars=1, secondPlayer.cards=2, secondPlayer.firstDraw=1,
secondPlayer.locations=1, drawPerTurn=2, deck.main=60,
recruit.on=true (Avatars in the deck; also recruit.avatarsInDeck=5, recruit.price=8),
buyAvatars.on=true (buy Avatars 2-4 instead of unlocking; buyAvatars.prices=8,12,16),
copies.waitATurn=true, copies.needAvatar2=true, copies.allowed=false,
commands.on=false (whole turns instead of rounds of commands),
commands.perPlayer=3, commands.leads=F|FS|FFSS|thue, commands.snake=false
--log play one game and print the play-by-play
--check check rule invariants after every action (slow)
--json FILE also write the summary and every game's result as JSON