First Part II module. The cumulative reference adds a second engine (src/engine/puzzle: grid, lexer, parser) beside Part I's; nouns and properties are data in src/content/words.json, and the engine names only IS/AND/NOT/TEXT and the base rule TEXT IS PUSH. Rules are recompiled from the board on every change; rules() is a sorted set. Adds the M6 scenarios and tests (rows, columns, shared IS, AND distribution, stacked text, base rule), the HOT word as a data-only Expansion Drop, the lesson with the Part II bridge, and the Rust LevelDef shape in harness.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
19 lines
495 B
TypeScript
19 lines
495 B
TypeScript
// Module 6 Expansion Drop: HOT. The scenario is in expansion/README.md.
|
|
import { expect, test } from "vitest";
|
|
import { newBaba } from "../src/harness";
|
|
|
|
test("test_06x_hot_word", () => {
|
|
const b = newBaba({ width: 5, height: 1, objects: [] });
|
|
for (const [word, x] of [
|
|
["LAVA", 0],
|
|
["IS", 1],
|
|
["HOT", 2],
|
|
["AND", 3],
|
|
["PUSH", 4],
|
|
] as const) {
|
|
b.place(`text:${word}`, x, 0);
|
|
}
|
|
|
|
expect(b.rules()).toEqual(["LAVA IS HOT", "LAVA IS PUSH", "TEXT IS PUSH"]);
|
|
});
|