clone

a browser grid puzzle game where you push words around to rewrite the rules of each level

main
miau-is-true / docs / worlds / clockwork.md
clockwork.md 6.6K source

Clockwork (world bible)

Pack: mods/worlds/clockwork.cjs (id clockwork, manifest.engine: 1). Contract and engine asks: clockwork-api.md.

Theme

A clock tower workshop after hours. Wind-up mice pace their tracks, cogs line the floor, and a brass bell waits somewhere the cat can't quite reach. Nothing here is alive, but some things keep moving between your steps.

World identity (manifest.world): glyph ⚙️, tagline "Some things keep walking after you stop.", accent push. The shipped loader accepts the field without validating it (see F-CW8).

Noun Glyph Facing Role
MIAU 🐈 left (built-in) the player
MOUSE 🐁 left (profile) the clockwork helper
COG ⚙️ none floor hazard (COG IS DEFEAT)
BELL 🔔 none the goal (BELL IS WIN)
WALL 🧱 none terrain

The custom property: TICK

X IS TICK makes every X repeat the level's step pattern, one beat per turn (a move or a wait). This is the engine's declarative level.automata. Every level declares its pattern as data. Levels 1, 2, and 5 bind the pattern to MOUSE with subject. Levels 3, 4, and 6 leave subject out, so whichever noun holds the TICK word follows the pattern. Moving the word hands the clockwork to something else.

Rules players meet, in order:

  1. Clockwork moves on its own, one step per turn, and pushes words.
  2. It only runs while its sentence holds.
  3. The word carries the clockwork: BELL IS TICK makes the goal walk.
  4. You can be clockwork too, and a double step skips the cell in between.
  5. Clockwork combines with core properties: a SINK mouse takes a cog with it.
  6. Challenge: the clockwork delivers a noun, and the hazard becomes the goal.

The world's second property (OPEN and SHUT, a paired contact effect) is a proposal (level.pairs, see clockwork-api.md). Its three draft levels run only on the prototype and aren't in the pack.

Levels

Solver: node --max-old-space-size=8000 tools/solve.mjs mods/worlds/clockwork.cjs --max 4000000 on the shipped engine. The full run takes about 4 minutes, and the default heap runs out of memory on an earlier, roomier layout of ring-for-service. HANDS-OFF comes from /tmp/clockwork-proto/verify.mjs: the level is winnable without the player pushing any word (F-CK9). No level is flagged BYPASS or TRIVIAL.

# id Title Category Teaches Steps Flags Intended insight
1 mouse-keeps-time The mouse keeps time required TICK exists; clockwork pushes words 11 HANDS-OFF (by design) Just walk. The mouse delivers WIN into BELL IS _ in a sealed lane on beat 5.
2 wind-it-up Wind it up required Writing MOUSE IS TICK 18 none The mouse is idle until you push TICK into MOUSE IS _. Then it delivers WIN.
3 ring-for-service Ring for service required The word carries the pattern 10 none The cat can't cross the cogs, but the bell can. Move TICK from the mouse to BELL IS _ and the bell walks to you.
4 double-time Double time required MIAU IS TICK; end-of-turn contacts 11 none The pattern is one step down. Make yourself TICK, stand above the cogs, and step down. You move twice and never stop on a cog.
5 mouse-hole Mouse hole required TICK with core SINK 23 none Push SINK into MOUSE IS TICK AND _. The diving mouse sinks one cog and leaves a gap.
6 escapement Escapement challenge Delivering a noun; transformation 29 none WIN is the bait: COG IS WIN still kills you, because DEFEAT beats WIN. Load BELL into the mouse's column instead, time it with the press, and COG IS BELL turns the hazard into the goal.

Shortest solutions (real solver):

  • mouse-keeps-time: DRRRRRRRRRR
  • wind-it-up: RRRRURULLDDRRRRRRR
  • ring-for-service: URRRDRRUDL
  • double-time: RRURULLLLDR
  • mouse-hole: URRRRRDRUUUUDDDDRDDDLLL
  • escapement: UUDUDUDUDURRRRRRRRRDRDLLLUDLD (the opening bobs are waits for the press to cycle; W works too)

All boards fit in 14×10, the largest being 11×10.

Bypass notes

  • mouse-keeps-time is hands-off on purpose. It's the "just watch" level that shows a word moving with nobody pushing it. It isn't flagged BYPASS, because the mouse moves a word.
  • Every other level needs the player to push a word. Both the frozen-words search (BYPASS) and the player-pushes-nothing search (HANDS-OFF) come back unsolvable.

Design notes

  • Locking sentences. No word tile can be fixed, so every rule the player must not break sits in a corner or fills an edge row (for example, mouse-hole row 0 is MIAU IS YOU MOUSE IS TICK AND _ BELL IS WIN, with the slot as the only gap). This costs rows and reads as clutter. Same finding as F-CW2 and F-XW2.
  • No patrol guards. Contacts resolve once, at the end of the turn, so a moving DEFEAT can be swapped through head-on (F-CK6). The world uses static cogs as the hazard and moving helpers as the tool. A guard level (stop-the-clock) was cut after three layouts.
  • Spacing. Stacked horizontal sentences keep a blank row between them. The only vertical sentences are deliberate crossings (BELL / IS / _ under BELL IS WIN, MIAU / IS / _ under MIAU IS YOU).
  • The last-moment transform in escapement. The shortest route steps onto a cog on the same turn the mouse pushes BELL into place. That's legal, because transforms run before contacts. A human will usually wait a turn and then step.
  • Solver cost. mouse-hole and escapement need --max 4000000 and about 3 minutes each. At the default they return LIMIT (F-CK9, F-CW4).
  • The engine changed three times during authoring. It went from no automata, to subject-bound automata with pushed things skipping their beat, to the shipped model. Levels were re-verified after each change.

OPEN and SHUT (proposal, not in the pack)

The draft levels are in /tmp/clockwork-proto/clockwork-pairs.cjs, verified on the prototype. See Appendix B of clockwork-api.md.

id Title Steps Idea
key-and-door Every door has a key 17 Build KEY IS PUSH AND OPEN, then push the key into the door.
any-wall-will-do Any wall will do 32 WALL IS STOP AND SHUT: any wall is a lock. Pick the thin side.
let-the-mouse-in Let the mouse in 13 Sealed in, you write MOUSE IS OPEN, and the pacing mouse opens your door.

If pairs ship, these slot in after level 2. The world would then teach TICK, then OPEN/SHUT, then a combination (let-the-mouse-in).