{ "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" } ] } ] }