v0.3.0 — playtest fixes, two new rules, and §7 enforced
This commit is contained in:
+13
-6
@@ -390,8 +390,13 @@ describe('the replay behaves like the game it is replaying', () => {
|
||||
// SAME functions — `cuesFor` decides what happened, `playCue` decides what it sounds like —
|
||||
// embedded by toString() exactly as the board renderers are. A second copy would drift, and a
|
||||
// replay that sounds different from the game is worse than a replay with no sound.
|
||||
const rec = record(880009, 'standard', 4000);
|
||||
const withCues = rec.frames.filter((f) => (f.cues?.length ?? 0) > 0);
|
||||
// POOLED OVER SEVERAL GAMES, because a single one cannot cover the set: measured over 40 games,
|
||||
// the bot couples in only 20% of them and sets cars out in 43%. This used to assert against one
|
||||
// seed and passed on luck — the moment the opening deal changed, that seed's game happened to
|
||||
// contain no switching at all and four of the six cues vanished. What is under test is the
|
||||
// plumbing, not one game, so the frames are pooled.
|
||||
const recs = [5, 4321, 880009].map((seed) => record(seed, 'standard', 4000));
|
||||
const withCues = recs.flatMap((rec) => rec.frames.filter((f) => (f.cues?.length ?? 0) > 0));
|
||||
assert.ok(withCues.length > 20, `only ${withCues.length} frames carry a cue`);
|
||||
|
||||
const kinds = new Set(withCues.flatMap((f) => f.cues ?? []));
|
||||
@@ -408,10 +413,12 @@ describe('the replay behaves like the game it is replaying', () => {
|
||||
// accounting the live game is held to. The switching cues are counted separately: they follow
|
||||
// what a crew does, not what the clock does.
|
||||
let boundaries = 0;
|
||||
for (let k = 1; k < rec.frames.length; k++) {
|
||||
const a = rec.frames[k - 1]!;
|
||||
const b = rec.frames[k]!;
|
||||
if (a.day !== b.day || a.stage !== b.stage) boundaries++;
|
||||
for (const rec of recs) {
|
||||
for (let k = 1; k < rec.frames.length; k++) {
|
||||
const a = rec.frames[k - 1]!;
|
||||
const b = rec.frames[k]!;
|
||||
if (a.day !== b.day || a.stage !== b.stage) boundaries++;
|
||||
}
|
||||
}
|
||||
const clock = withCues
|
||||
.flatMap((f) => f.cues ?? [])
|
||||
|
||||
Reference in New Issue
Block a user