feat(tools): play-spellgrid stages the M10 reference with cards and levels and runs its CLI

Lesson 10 and both M10 reference READMEs now give the real recipe
(node tools/play-spellgrid.mjs <rust|ts> [l1|l2|l3]); root script play:spellgrid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Opus 5.5 committed 2026-10-29 19:08:17 +01:00
1 parent ad0701395d
commit bb98be089a
6 files changed
+144 -8

No files matched your search

+5 -3
View File
@@ -249,13 +249,15 @@ syncRules(): // seam 1
### Play it
The reference ships a command line, kept thin over the harness. From a workspace with `cards/` and `levels/`:
The reference ships a command line, kept thin over the harness. It reads `cards/` and `levels/` from the directory it runs in, so `tools/play-spellgrid.mjs` stages the reference with the course's cards and levels into a temporary directory and starts it. From the course repository:
```sh
cargo run --bin spellgrid -- levels/l1-double-tap.json # Rust
npx tsx src/cli.ts levels/l1-double-tap.json # TypeScript
node tools/play-spellgrid.mjs rust l1 # Rust: cargo run --bin spellgrid -- levels/l1-double-tap.json
node tools/play-spellgrid.mjs ts l1 # TypeScript: npx tsx src/cli.ts levels/l1-double-tap.json
```
The level is `l1`, `l2` or `l3` (or a path to a level file of your own). `--dir <dir>` stages into a directory you choose and keeps it, and `--stage-only` prints the command without running it. The tool prints where it staged, so you can run the command there again.
`w`, `a`, `s`, `d` play a turn; `c <card> [x y]` casts a spell (at the minion on that tile, if given) or plays a minion (onto that empty tile); `q` quits. Graft asks for its base, donor and half; answer with a number or a name. Writing your own is optional: the course's tests don't call it.
## Name it