feat: undo in Module 9 and stackAt from Module 8; Lesson 8 quote matches the reference

Baba.undo() restores the level before the last step or move (board snapshot:
objects in age order with ids, the id counter, and won; rules recompiled).
place clears the history. SpellGrid's undo throws/panics 'not supported'.
stackAt / stack_at lists a tile's kinds oldest first, on Baba and SpellGrid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Opus 5.5 committed 2026-11-11 11:20:03 +01:00
1 parent 21fb40c6f5
commit 820b378929
27 files changed
+530 -30

No files matched your search

@@ -12,6 +12,6 @@ The course's own engine as of the end of Module 8. Part I's card engine is uncha
- The rest of `src/engine/`: Part I, unchanged.
- `src/content/movement.rs` (new) and `src/content/mod.rs`: the movement responses, in the order the engine runs them: `OPEN`/`SHUT`, `PUSH`, `STOP`. What a property does when something moves is content, not engine.
- `src/content/words.json`: Module 8 adds `OPEN` and `SHUT`.
- `src/harness.rs`: the adapter the course tests call. Module 8 adds `Baba::move_dir`, `Baba::pos_of`, `Baba::kinds_at`, and re-exports `Dir`.
- `src/harness.rs`: the adapter the course tests call. Module 8 adds `Baba::move_dir`, `Baba::pos_of`, `Baba::kinds_at`, `Baba::stack_at`, and re-exports `Dir`.
Run it with the module's tests: `node tools/verify-references.mjs 08` from the course repository.