Support 2-6 players: the L, the cross, and the 3x2 from the rulebook

Three player counts join the square and the column: 3 players get the
stair/L with the AUTO WARP joining the two openings that face the
concave notch (convex openings pair geometrically — flagged as
interpretation of the diagram's letters); 5 players get the plus/cross
with tip-to-tip wraps and aisle-warp corners; 6 players get the 3x2
rectangle with straight-across wraps. All six verified layouts are
drawn on, so no count repeats a sector. Rooms accept up to six seats;
the lobby copy follows. 122 tests passing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-16 00:08:15 -04:00
co-authored by Claude Fable 5
parent 8d10dfee67
commit 85b40be113
4 changed files with 98 additions and 7 deletions
+30
View File
@@ -106,3 +106,33 @@ describe("board assembly", () => {
expect(hasLineOfSight(board, { x: 2, y: 2 }, { x: 2, y: 0 })).toBe(false);
});
});
describe("player counts 2-6", () => {
it("assembles a coherent board for every supported count", async () => {
const { setupBoard } = await import("../src/setups");
const { createRng } = await import("../src/rng");
for (const n of [2, 3, 4, 5, 6]) {
const { board } = setupBoard(n, createRng(n * 7));
expect(board.homes.length).toBe(n);
expect(board.placements.length).toBe(n);
// Every warp starts and ends on real cells, through open edges.
for (const w of board.warps) {
expect(board.cells[`${w.from.cell.x},${w.from.cell.y}`]).toBe(true);
expect(board.cells[`${w.to.cell.x},${w.to.cell.y}`]).toBe(true);
}
// No two sectors share a layout.
const ids = board.placements.map((p) => p.boardId);
expect(new Set(ids).size).toBe(n);
}
});
it("full games start at every count", async () => {
const { createGame } = await import("../src/game");
for (const n of [3, 5, 6]) {
const ids = Array.from({ length: n }, (_, i) => `w${i}`);
const { state } = createGame({ playerIds: ids, seed: 99 + n, sets: ["basic", "expansion1"] });
expect(state.players.length).toBe(n);
expect(state.treasures.length).toBe(n * 2);
}
});
});