v0.8.0.8 — a played train does not come back; a discarded one does
Jesse's ruling on the question v0.8.0.7 filed: once a regularly scheduled train has been played its number is on the timetable, so putting it back into a reshuffled deck to be played again makes no sense. The same card sitting in a discard pile was never played and its slot is still open, so it should come back. An Extra is a single run rather than a standing slot, so a played one is free to run again. The test is therefore WHERE the card is, not only what it is — which is worth writing down, because it is exactly the rule a later tidy-up would simplify into filtering by kind everywhere. And the duplicate that started it: trainScheduled was pushing a synthetic train-<number> into the Salvage Yard beside the real card cardPlayed had already put there — four scheduled trains left eight entries in a pile holding four cards. Nothing read it, it inflated the depth, it displayed as "a card", and it would have been swept into the draw deck to be drawn as an id with nothing behind it. Removed, which retires the phantom-id class rather than papering over it, so v0.8.0.7's cardName resolver for it goes too. Games in progress resume: no predicate changed its answer, and a draw is a draw whatever is on top. What differs is the Yard's depth, which was double-counting, and what a reshuffle recovers — and reshuffles are effectively unreachable, with zero seen across eight games driven to 4000 moves. Closes #23. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6cF1iYvJ1kNmzYBzu4QX6
This commit is contained in:
co-authored by
Claude Opus 5
parent
d0e5091824
commit
072029b1f7
@@ -1791,23 +1791,6 @@ export function snapshot(
|
||||
|
||||
/** A card id turned into something a person can read. */
|
||||
export function cardName(s: GameState, id: string): string {
|
||||
/**
|
||||
* A SCHEDULED TRAIN IS IN THE SALVAGE YARD UNDER A SYNTHETIC ID, and without this the pile that is
|
||||
* supposed to be face up reads "a card".
|
||||
*
|
||||
* `trainScheduled` pushes `train-<number>` rather than the id of the card that was played
|
||||
* (`apply.ts`), so there is nothing in `s.cards` to look up — and since a train is scheduled
|
||||
* several times a Day, that synthetic id is on top of the Salvage Yard most of the time. Reported
|
||||
* by Jesse 2026-09-10 as "why is salvage deck not face up. I should see the card played onto
|
||||
* salvage": it was face up all along and simply had nothing to say.
|
||||
*
|
||||
* Resolved here rather than in the engine because this is a NAME, which is this file's job. Whether
|
||||
* the engine should be pushing a real card id instead is a separate question with a separate
|
||||
* consequence — the Salvage Yard is swept back into the draw deck when it runs out — and is filed
|
||||
* rather than answered in passing.
|
||||
*/
|
||||
const scheduled = /^train-(\d+)$/.exec(id);
|
||||
if (scheduled) return `Train ${scheduled[1]}`;
|
||||
const k = s.cards.get(id)?.kind;
|
||||
if (!k) return 'a card';
|
||||
switch (k.kind) {
|
||||
|
||||
Reference in New Issue
Block a user