Files
functional-programming-snake/fixtures/m10-golden.json
T
Lucas WintherandClaude Fable 5.2 edd57f0148 feat(course): audit fixes and twelve extensions (Modules 7b, 12, 13)
Audit pass:
- Frame rule counts frames since the last move, so every step lasts
  exactly movesEvery(score) frames, also right after a speed-up
- clampTime + MAX_GAP_MS: a hidden tab no longer replays the whole gap
- Pong Restart keeps held keys
- Fact corrections (mulberry32 output coverage, Haskell IO, uniform)
- New fixture cases from a mutation analysis

Extensions (all three tracks, shared fixtures, course text):
- Turn queue (Exercise 10.6), persisted high score (10.7),
  replay viewer (10.8), play() end-to-end helper (9.5)
- Optional State (4.7) and optional Module 7b, stack-safe IO
- Module 12, property-based testing with generators, shrinking,
  invariants and a model-based oracle
- Module 13, Conway's Life with a Click event
- JS type checking via jsconfig, JSDoc and types.d.ts
- Maintainer tools: scripts/mutate.mjs, scripts/typecheck-js.sh,
  Playwright end-to-end suite (e2e/, scripts/e2e.sh)

Docs: docs/contract.md is the canonical contract; specs and build log
under docs/superpowers.

Verified: JS 728, Scala 689, F# 691 unit tests; stubs and progression
M01-M13 and M07b; 176 end-to-end tests on Chromium and WebKit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 12:05:29 +01:00

695 lines
13 KiB
JSON

{
"function": "play",
"cases": [
{
"name": "seed-42-eats-three-apples-with-no-stored-best",
"args": [
42,
[
{
"tag": "KeyDown",
"key": "ArrowUp"
},
{
"tag": "Time",
"t": 200
},
{
"tag": "KeyDown",
"key": "ArrowLeft"
},
{
"tag": "Time",
"t": 450
},
{
"tag": "Time",
"t": 700
},
{
"tag": "Time",
"t": 950
},
{
"tag": "Time",
"t": 1200
},
{
"tag": "Time",
"t": 1450
},
{
"tag": "Time",
"t": 1700
},
{
"tag": "Time",
"t": 1950
},
{
"tag": "Time",
"t": 2000
},
{
"tag": "KeyDown",
"key": "ArrowUp"
},
{
"tag": "Time",
"t": 2250
},
{
"tag": "Time",
"t": 2500
},
{
"tag": "Time",
"t": 2750
},
{
"tag": "Time",
"t": 2800
},
{
"tag": "KeyDown",
"key": "ArrowRight"
},
{
"tag": "Time",
"t": 3050
},
{
"tag": "Time",
"t": 3300
},
{
"tag": "Time",
"t": 3550
},
{
"tag": "Time",
"t": 3800
},
{
"tag": "Time",
"t": 4050
},
{
"tag": "Time",
"t": 4300
},
{
"tag": "Time",
"t": 4550
},
{
"tag": "Time",
"t": 4800
},
{
"tag": "Time",
"t": 5050
},
{
"tag": "Time",
"t": 5300
},
{
"tag": "Time",
"t": 5400
},
{
"tag": "KeyDown",
"key": "ArrowUp"
},
{
"tag": "Time",
"t": 5650
},
{
"tag": "Time",
"t": 5900
},
{
"tag": "Time",
"t": 6150
},
{
"tag": "Time",
"t": 6200
}
],
0
],
"expected": [
{
"tag": "Rect",
"x": 0,
"y": 0,
"w": 400,
"h": 400,
"color": "#111111"
},
{
"tag": "Rect",
"x": 21,
"y": 161,
"w": 18,
"h": 18,
"color": "#e53935"
},
{
"tag": "Rect",
"x": 281,
"y": 21,
"w": 18,
"h": 18,
"color": "#7cb342"
},
{
"tag": "Rect",
"x": 281,
"y": 41,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Rect",
"x": 281,
"y": 61,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Rect",
"x": 281,
"y": 81,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Rect",
"x": 281,
"y": 101,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Rect",
"x": 261,
"y": 101,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Text",
"x": 6,
"y": 18,
"text": "Score: 3",
"color": "#ffffff",
"size": 16,
"align": "left"
},
{
"tag": "Text",
"x": 394,
"y": 18,
"text": "Best: 3",
"color": "#ffffff",
"size": 16,
"align": "right"
}
]
},
{
"name": "seed-7-beats-a-stored-best-of-2-and-hits-the-wall",
"args": [
7,
[
{
"tag": "Time",
"t": 250
},
{
"tag": "Time",
"t": 500
},
{
"tag": "Time",
"t": 750
},
{
"tag": "Time",
"t": 1000
},
{
"tag": "Time",
"t": 1250
},
{
"tag": "Time",
"t": 1500
},
{
"tag": "Time",
"t": 1750
},
{
"tag": "Time",
"t": 1800
},
{
"tag": "KeyDown",
"key": "ArrowDown"
},
{
"tag": "Time",
"t": 2050
},
{
"tag": "Time",
"t": 2200
},
{
"tag": "KeyDown",
"key": "ArrowLeft"
},
{
"tag": "Time",
"t": 2450
},
{
"tag": "Time",
"t": 2700
},
{
"tag": "Time",
"t": 2950
},
{
"tag": "Time",
"t": 3200
},
{
"tag": "KeyDown",
"key": "ArrowDown"
},
{
"tag": "Time",
"t": 3450
},
{
"tag": "Time",
"t": 3700
},
{
"tag": "Time",
"t": 3950
},
{
"tag": "Time",
"t": 4200
},
{
"tag": "KeyDown",
"key": "ArrowLeft"
},
{
"tag": "Time",
"t": 4375
},
{
"tag": "KeyDown",
"key": "ArrowUp"
},
{
"tag": "Time",
"t": 4625
},
{
"tag": "Time",
"t": 4875
},
{
"tag": "Time",
"t": 5125
},
{
"tag": "Time",
"t": 5375
},
{
"tag": "Time",
"t": 5600
},
{
"tag": "KeyDown",
"key": "ArrowRight"
},
{
"tag": "Time",
"t": 5850
},
{
"tag": "Time",
"t": 6100
},
{
"tag": "Time",
"t": 6350
},
{
"tag": "Time",
"t": 6600
},
{
"tag": "Time",
"t": 6825
}
],
2
],
"expected": [
{
"tag": "Rect",
"x": 0,
"y": 0,
"w": 400,
"h": 400,
"color": "#111111"
},
{
"tag": "Rect",
"x": 321,
"y": 81,
"w": 18,
"h": 18,
"color": "#e53935"
},
{
"tag": "Rect",
"x": 381,
"y": 201,
"w": 18,
"h": 18,
"color": "#7cb342"
},
{
"tag": "Rect",
"x": 361,
"y": 201,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Rect",
"x": 341,
"y": 201,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Rect",
"x": 321,
"y": 201,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Rect",
"x": 301,
"y": 201,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Rect",
"x": 281,
"y": 201,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Rect",
"x": 261,
"y": 201,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Text",
"x": 6,
"y": 18,
"text": "Score: 4",
"color": "#ffffff",
"size": 16,
"align": "left"
},
{
"tag": "Text",
"x": 200,
"y": 200,
"text": "Game Over",
"color": "#ffffff",
"size": 32,
"align": "center"
},
{
"tag": "Text",
"x": 200,
"y": 230,
"text": "Press R to restart",
"color": "#ffffff",
"size": 16,
"align": "center"
},
{
"tag": "Text",
"x": 394,
"y": 18,
"text": "Best: 4",
"color": "#ffffff",
"size": 16,
"align": "right"
}
]
},
{
"name": "seed-42-restart-after-game-over-keeps-the-best",
"args": [
42,
[
{
"tag": "KeyDown",
"key": "ArrowUp"
},
{
"tag": "Time",
"t": 200
},
{
"tag": "KeyDown",
"key": "ArrowLeft"
},
{
"tag": "Time",
"t": 450
},
{
"tag": "Time",
"t": 700
},
{
"tag": "Time",
"t": 950
},
{
"tag": "Time",
"t": 1200
},
{
"tag": "Time",
"t": 1450
},
{
"tag": "Time",
"t": 1700
},
{
"tag": "Time",
"t": 1950
},
{
"tag": "Time",
"t": 2000
},
{
"tag": "KeyDown",
"key": "ArrowUp"
},
{
"tag": "Time",
"t": 2250
},
{
"tag": "Time",
"t": 2500
},
{
"tag": "Time",
"t": 2750
},
{
"tag": "Time",
"t": 2800
},
{
"tag": "KeyDown",
"key": "ArrowRight"
},
{
"tag": "Time",
"t": 3050
},
{
"tag": "Time",
"t": 3300
},
{
"tag": "Time",
"t": 3550
},
{
"tag": "Time",
"t": 3800
},
{
"tag": "Time",
"t": 4050
},
{
"tag": "Time",
"t": 4300
},
{
"tag": "Time",
"t": 4550
},
{
"tag": "Time",
"t": 4800
},
{
"tag": "Time",
"t": 5050
},
{
"tag": "Time",
"t": 5300
},
{
"tag": "Time",
"t": 5550
},
{
"tag": "Time",
"t": 5800
},
{
"tag": "Time",
"t": 6050
},
{
"tag": "Time",
"t": 6300
},
{
"tag": "Time",
"t": 6550
},
{
"tag": "Time",
"t": 6600
},
{
"tag": "KeyDown",
"key": "r"
}
],
0
],
"expected": [
{
"tag": "Rect",
"x": 0,
"y": 0,
"w": 400,
"h": 400,
"color": "#111111"
},
{
"tag": "Rect",
"x": 261,
"y": 61,
"w": 18,
"h": 18,
"color": "#e53935"
},
{
"tag": "Rect",
"x": 201,
"y": 201,
"w": 18,
"h": 18,
"color": "#7cb342"
},
{
"tag": "Rect",
"x": 181,
"y": 201,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Rect",
"x": 161,
"y": 201,
"w": 18,
"h": 18,
"color": "#43a047"
},
{
"tag": "Text",
"x": 6,
"y": 18,
"text": "Score: 0",
"color": "#ffffff",
"size": 16,
"align": "left"
},
{
"tag": "Text",
"x": 394,
"y": 18,
"text": "Best: 2",
"color": "#ffffff",
"size": 16,
"align": "right"
}
]
}
]
}