Module 9 lesson, scenarios, tests (8, both tracks), reference engines (TURN phase list, conversion, content-registered hazards, win/lost), WEAK Expansion Drop, harness.md M9 semantics, research notes (WEAK page, baba-is-auto Game::MovePlayer, X IS NOT X placement reading). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Module 9 Expansion Drop: WEAK
The lesson's Expansion Drop beat explains the task. This file holds the scenario, the test locations and the check.
- Word: WEAK, a property. From the Baba Is You Wiki's WEAK page (recorded in
docs/research/baba-is-you.md§5): "WEAK is a property that makes an object be destroyed if it overlaps any same-float object or collides with any object.", and "Destruction by WEAK happens after SINK BOOM, but before other overlap checks." The drop adds the overlap half only. - Tests:
tests/rust/test_09x.rsandtests/ts/test_09x.test.ts. Copy the one for your track into your workspace'stests/. - Reference answer, one change in data and one in content code:
solution/words.json, one file for both tracks: the Module 9 reference'ssrc/content/words.jsonwith one entry added,{ "name": "WEAK", "role": "property" }.solution/rust/src/content/hazards.rsandsolution/ts/src/content/hazards.ts: the Module 9 reference's hazards with one hazard added,weak, listed aftersink.- Nothing under
src/engine/changes, and neither does the harness. WEAK is a new hazard, so it is new code, but it is a hazard the engine's hazards phase runs like any other.
- 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.
The other half of the WEAK page, "If a WEAK object attempts to move into a solid object and fails ... it is destroyed", is a movement check, not a hazard. The reference leaves it out and this test doesn't check it.
Scenario
test_09x_weak_breaks
- Setup:
newBabawith an empty level 5 wide and 4 high. PlaceBABA (0,0) IS (1,0) YOU (2,0)andROCK (0,1) IS (1,1) WEAK (2,1). Place an objectbabaat (0,3), an objectrockat (1,3) (the near rock) and an objectrockat (3,3) (the far rock). - Action:
step("right"). - Assertions:
posOf(baba)is (1,3): a rock that is only WEAK doesn't block.posOf(nearRock)isnullandkindsAt(1,3)is["baba"]: Baba stepped onto the near rock, and a WEAK object that shares its tile with anything is destroyed.posOf(farRock)is (3,3): alone on its tile, the far rock is untouched.
Before the drop the lexicon doesn't know WEAK, so ROCK IS WEAK spells nothing: Baba stands on the near rock and both survive.