Files
systemic-game-design-course/course/09-turn-pipeline/reference/ts
Lucas WintherandClaude Fable 5.2 8467c7929e fix(puzzle): an object steps once per movement phase; negated conversion is settled per object
Bug 1 (modules 08-10): a YOU object pulled by an earlier mover took a second step of its own. Level movement now keeps the ids that stepped in a committed plan this phase; such a YOU object starts no move, and Planner try_move answers no for it. Regression: test_08x_pulled_you_moves_once (Module 8 Expansion Drop).

Bug 2 (modules 09-10): convert honoured negation only per rule, so ALL IS ROCK beat BABA IS NOT ROCK. A target Y is now skipped for an object if any active negated rule IS NOT Y names it. Module 9 and 10 references (and their drop solutions) now carry ALL, the Module 7 Expansion Drop. Regression: test_09_negated_conversion_beats_group.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 09:18:00 +01:00
..
2026-10-29 04:28:17 +01:00
2026-10-29 04:28:17 +01:00
2026-10-29 04:28:17 +01:00
2026-10-29 04:28:17 +01:00
2026-10-29 04:28:17 +01:00

Module 9 reference engine (TypeScript)

The course's own engine as of the end of Module 9. Part I's card engine is unchanged, and all of its tests still pass. The Part II engine in src/engine/puzzle/ now plays a whole turn: movement, parse, conversion, parse, hazards, win, parse. Module 8's reference was the starting point, so a diff between the two shows what this module adds.

  • cards/ (at the package root; not in this directory): Part I's card data, a copy of course/cards/ staged by tools/verify-references.mjs. Part II doesn't read it.
  • src/engine/puzzle/: the Part II engine. It names no noun: the engine's own words are the operators IS, AND, NOT, the meta-noun TEXT, the property PUSH of the base rule TEXT IS PUSH, the property YOU, which picks the objects that move, and from Module 9 the properties WIN (the win check) and FLOAT (which objects share a tile).
    • turn.ts (new): the turn. Phase, TURN (the phases in order) and Hazard (content's rule for what destroys what).
    • level.ts: a level in play. Module 9 adds Level.step, which runs the phases of TURN; the conversion phase (X IS Y in place, X IS X locks, X IS NOT X deletes, and ... IS NOT Y keeps every object it names from becoming a Y, as hasProperty settles negation per object); the hazards phase, which runs content's hazards in order; the win check; Level.sharing (the other objects on a tile at the same float level); won and lost. The Level constructor takes the hazards. moveYou is now movement, then a reparse.
    • grid.ts: Module 9 adds Board.setKind.
    • word.ts: Module 9 adds Lexicon.thingNamed (what a conversion into a noun makes).
    • movement.ts, parse.ts, resolve.ts: unchanged.
    • index.ts: the module's exports.
  • The rest of src/engine/: Part I, unchanged.
  • src/content/hazards.ts (new) and src/content/index.ts: the hazards, in the order the engine runs them: SINK, HOT/MELT, DEFEAT. What destroys what at the end of a turn is content, not engine.
  • src/content/movement.ts: unchanged.
  • src/content/words.json: Module 9 adds HOT, MELT, SINK, DEFEAT and FLOAT, and ALL, the Module 7 Expansion Drop, which the Module 9 tests need.
  • src/harness.ts: the adapter the course tests call. Module 9 adds step, won and lost on Baba.

Run it with the module's tests: node tools/verify-references.mjs 09 from the course repository.