Fix caching, Limits placement, and explain the board better
This commit is contained in:
@@ -416,6 +416,46 @@ describe('card coverage', () => {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
describe('the Limits sign moves with the Running Track (§2.1, Gap 4a)', () => {
|
||||
it('refuses to build beyond the Limits sign', () => {
|
||||
// §2.1 — the Running Track runs BETWEEN the Limits, so the sign is the only growth point.
|
||||
// Offering the square PAST it produced, from one straight laid at (0,2):
|
||||
// limits · Whistle Post · limits · straight · limits
|
||||
// — track on the far side of the sign, and a second sign planted beyond that.
|
||||
const s = game();
|
||||
const area = areaOf(s, 0);
|
||||
s.turn.option = 'draw';
|
||||
|
||||
const beyondEast = { row: area.runningRow, col: area.limitsEast.col + 1 };
|
||||
const beyondWest = { row: area.runningRow, col: area.limitsWest.col - 1 };
|
||||
for (const placement of [beyondEast, beyondWest]) {
|
||||
assert.notEqual(
|
||||
check(s, 0, { type: 'track.lay', geometry: 'straight', hand: 'none', placement, variant: 0 }),
|
||||
null,
|
||||
`(${placement.row},${placement.col}) is outside the Limits and must not be placeable`,
|
||||
);
|
||||
}
|
||||
|
||||
// The sign itself IS legal — that is how the Running Track grows.
|
||||
assert.equal(
|
||||
check(s, 0, {
|
||||
type: 'track.lay', geometry: 'straight', hand: 'none',
|
||||
placement: { row: area.runningRow, col: area.limitsEast.col }, variant: 0,
|
||||
}),
|
||||
null,
|
||||
'laying on the Limits sign must be how the track extends',
|
||||
);
|
||||
|
||||
// The district hangs below the Running Track and is not bounded by the Limits at all.
|
||||
assert.equal(
|
||||
check(s, 0, {
|
||||
type: 'track.lay', geometry: 'straight', hand: 'none',
|
||||
placement: { row: area.runningRow - 1, col: 0 }, variant: 1,
|
||||
}),
|
||||
null,
|
||||
'Secondary Track below the Office must stay legal',
|
||||
);
|
||||
});
|
||||
|
||||
it('keeps the Limits at the ends, never stranded mid-track', () => {
|
||||
// Found by watching a replay: a district grew to
|
||||
// (0,-5) (0,-4) (0,-3) (0,-2)=Power Plant [LIMITS] (0,0)=Office [LIMITS] (0,2) …
|
||||
|
||||
Reference in New Issue
Block a user