Module 1 Expansion Drop: playing a card from hand
The lesson's Expansion Drop beat explains the task. This file holds the scenario, the test locations and the check.
- Tests:
tests/rust/test_01x.rsandtests/ts/test_01x.test.ts. Copy the one for your track into your workspace'stests/. - Reference answer:
solution/rust/src/harness.rsandsolution/ts/src/harness.ts. Each is the Module 1 reference harness withplayfilled in. Nothing undersrc/engine/changes. - Check: commit your workspace before you start, then run
node tools/expansion-check.mjs <your-workspace> <that-commit>from the course repository. It fails if any file undersrc/engine/changed.
Scenario
test_01x_play_assigns_order_on_entry
- Setup: an empty game (
newGame(), ornew_game(GameOpts::default())in Rust). - Action: add a
Test Fillerto player 0's hand (id H). Then summon aTest Fillerfor player 0 (id S). Thenplay(H). - Assertions:
zoneOf(H)is board.hand(0)is empty.board(0)is[S, H]: a played card goes to the right end of the board.orderOfPlay(H) > orderOfPlay(S). H was created before S, but S entered play first.