{ "function": "viewerView", "cases": [ {"name":"first-frame-not-playing","args":[[{"width":20,"height":20,"snake":[{"x":10,"y":10},{"x":9,"y":10},{"x":8,"y":10}],"dir":"Right","nextDir":"Right","apple":{"x":1,"y":9},"seed":1831565855,"score":0,"status":"Playing","frame":0,"queued":null},{"width":20,"height":20,"snake":[{"x":11,"y":10},{"x":10,"y":10},{"x":9,"y":10}],"dir":"Right","nextDir":"Right","apple":{"x":1,"y":9},"seed":1831565855,"score":0,"status":"Playing","frame":0,"queued":null},{"width":20,"height":20,"snake":[{"x":11,"y":10},{"x":10,"y":10},{"x":9,"y":10}],"dir":"Right","nextDir":"Up","apple":{"x":1,"y":9},"seed":1831565855,"score":0,"status":"Playing","frame":0,"queued":null}],{"index":0,"last":2,"playing":false}],"expected":[{"tag":"Rect","x":0,"y":0,"w":400,"h":400,"color":"#111111"},{"tag":"Rect","x":21,"y":181,"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":"step 0 / 2","color":"#ffffff","size":16,"align":"right"},{"tag":"Text","x":200,"y":392,"text":"Left/Right: step Home/End: jump Space: play","color":"#aaaaaa","size":12,"align":"center"}]}, {"name":"middle-frame-while-playing","args":[[{"width":20,"height":20,"snake":[{"x":10,"y":10},{"x":9,"y":10},{"x":8,"y":10}],"dir":"Right","nextDir":"Right","apple":{"x":1,"y":9},"seed":1831565855,"score":0,"status":"Playing","frame":0,"queued":null},{"width":20,"height":20,"snake":[{"x":11,"y":10},{"x":10,"y":10},{"x":9,"y":10}],"dir":"Right","nextDir":"Right","apple":{"x":1,"y":9},"seed":1831565855,"score":0,"status":"Playing","frame":0,"queued":null},{"width":20,"height":20,"snake":[{"x":11,"y":10},{"x":10,"y":10},{"x":9,"y":10}],"dir":"Right","nextDir":"Up","apple":{"x":1,"y":9},"seed":1831565855,"score":0,"status":"Playing","frame":0,"queued":null}],{"index":1,"last":2,"playing":true}],"expected":[{"tag":"Rect","x":0,"y":0,"w":400,"h":400,"color":"#111111"},{"tag":"Rect","x":21,"y":181,"w":18,"h":18,"color":"#e53935"},{"tag":"Rect","x":221,"y":201,"w":18,"h":18,"color":"#7cb342"},{"tag":"Rect","x":201,"y":201,"w":18,"h":18,"color":"#43a047"},{"tag":"Rect","x":181,"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":"step 1 / 2","color":"#ffffff","size":16,"align":"right"},{"tag":"Text","x":200,"y":392,"text":"Space: pause","color":"#aaaaaa","size":12,"align":"center"}]}, {"name":"last-frame","args":[[{"width":20,"height":20,"snake":[{"x":10,"y":10},{"x":9,"y":10},{"x":8,"y":10}],"dir":"Right","nextDir":"Right","apple":{"x":1,"y":9},"seed":1831565855,"score":0,"status":"Playing","frame":0,"queued":null},{"width":20,"height":20,"snake":[{"x":11,"y":10},{"x":10,"y":10},{"x":9,"y":10}],"dir":"Right","nextDir":"Right","apple":{"x":1,"y":9},"seed":1831565855,"score":0,"status":"Playing","frame":0,"queued":null},{"width":20,"height":20,"snake":[{"x":11,"y":10},{"x":10,"y":10},{"x":9,"y":10}],"dir":"Right","nextDir":"Up","apple":{"x":1,"y":9},"seed":1831565855,"score":0,"status":"Playing","frame":0,"queued":null}],{"index":2,"last":2,"playing":false}],"expected":[{"tag":"Rect","x":0,"y":0,"w":400,"h":400,"color":"#111111"},{"tag":"Rect","x":21,"y":181,"w":18,"h":18,"color":"#e53935"},{"tag":"Rect","x":221,"y":201,"w":18,"h":18,"color":"#7cb342"},{"tag":"Rect","x":201,"y":201,"w":18,"h":18,"color":"#43a047"},{"tag":"Rect","x":181,"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":"step 2 / 2","color":"#ffffff","size":16,"align":"right"},{"tag":"Text","x":200,"y":392,"text":"Left/Right: step Home/End: jump Space: play","color":"#aaaaaa","size":12,"align":"center"}]} ] }