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:
parent
6382de19c9
commit
a3eb6850ee
21 changed files with 1089 additions and 96 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import type { CardPool } from './cards.ts';
|
||||
import { gridCount } from './engine.ts';
|
||||
import { roundsPlayed } from './state.ts';
|
||||
import { STAT_KEYS, type CardUse, type GameState, type StatKey } from './types.ts';
|
||||
|
||||
export interface GameRecord {
|
||||
|
|
@ -7,6 +8,7 @@ export interface GameRecord {
|
|||
winner: 0 | 1 | null;
|
||||
firstPlayer: 0 | 1;
|
||||
turns: number;
|
||||
rounds: number;
|
||||
locations: [number, number];
|
||||
stats: Record<StatKey, [number, number]>;
|
||||
cardUse: Record<string, CardUse>;
|
||||
|
|
@ -31,6 +33,7 @@ export function recordOf(seed: number, s: GameState): GameRecord {
|
|||
winner: s.winner,
|
||||
firstPlayer: s.firstPlayer,
|
||||
turns: s.turn,
|
||||
rounds: roundsPlayed(s),
|
||||
locations: [gridCount(s, 0), gridCount(s, 1)],
|
||||
stats: s.stats,
|
||||
cardUse: s.cardUse,
|
||||
|
|
@ -38,8 +41,7 @@ export function recordOf(seed: number, s: GameState): GameRecord {
|
|||
};
|
||||
}
|
||||
|
||||
/** Rounds: both players taking one turn each. */
|
||||
const roundsOf = (r: GameRecord) => Math.ceil(r.turns / 2);
|
||||
const roundsOf = (r: GameRecord) => r.rounds;
|
||||
|
||||
export function summarize(records: GameRecord[]): BatchSummary {
|
||||
const n = records.length;
|
||||
|
|
@ -79,7 +81,7 @@ export function formatSummary(sum: BatchSummary, labels: [string, string]): stri
|
|||
' Draws (turn limit)'.padEnd(36) + pct(sum.draws, sum.games),
|
||||
' First player wins'.padEnd(36) + `${pct(sum.firstPlayerWins, decided)} of decided games`,
|
||||
'',
|
||||
'Game length, in rounds (both players take a turn)',
|
||||
'Game length, in rounds (every player takes all their commands, or a turn)',
|
||||
` mean ${fmt(sum.rounds.mean)} · median ${sum.rounds.median} · 10% of games ≤ ${sum.rounds.p10} · 90% ≤ ${sum.rounds.p90}`,
|
||||
'',
|
||||
row('Average per player, per game', labels[0], labels[1]),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue