1107 lines
20 KiB
JSON
1107 lines
20 KiB
JSON
{
|
|
"function": "update",
|
|
"cases": [
|
|
{
|
|
"name": "toggle-pause-pauses-a-playing-game",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 0
|
|
},
|
|
{
|
|
"tag": "TogglePause"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Paused",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "toggle-pause-resumes-a-paused-game",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Paused",
|
|
"frame": 0
|
|
},
|
|
{
|
|
"tag": "TogglePause"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "toggle-pause-ignored-when-game-over",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "GameOver",
|
|
"frame": 0
|
|
},
|
|
{
|
|
"tag": "TogglePause"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "GameOver",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "toggle-pause-ignored-when-won",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Won",
|
|
"frame": 0
|
|
},
|
|
{
|
|
"tag": "TogglePause"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Won",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "turn-while-paused-is-ignored",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Paused",
|
|
"frame": 0
|
|
},
|
|
{
|
|
"tag": "Turn",
|
|
"dir": "Up"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Paused",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "tick-while-paused-is-ignored",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Paused",
|
|
"frame": 0
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Paused",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "restart-from-playing-starts-a-new-game-with-the-same-seed",
|
|
"args": [
|
|
{
|
|
"width": 20,
|
|
"height": 20,
|
|
"snake": [
|
|
{
|
|
"x": 3,
|
|
"y": 3
|
|
}
|
|
],
|
|
"dir": "Up",
|
|
"nextDir": "Up",
|
|
"apple": null,
|
|
"seed": 0,
|
|
"score": 5,
|
|
"status": "Playing",
|
|
"frame": 9
|
|
},
|
|
{
|
|
"tag": "Restart"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 20,
|
|
"height": 20,
|
|
"snake": [
|
|
{
|
|
"x": 10,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 9,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 8,
|
|
"y": 10
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 18,
|
|
"y": 13
|
|
},
|
|
"seed": 1831565813,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "restart-from-game-over",
|
|
"args": [
|
|
{
|
|
"width": 20,
|
|
"height": 20,
|
|
"snake": [
|
|
{
|
|
"x": 10,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 9,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 8,
|
|
"y": 10
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": null,
|
|
"seed": 0,
|
|
"score": 2,
|
|
"status": "GameOver",
|
|
"frame": 0
|
|
},
|
|
{
|
|
"tag": "Restart"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 20,
|
|
"height": 20,
|
|
"snake": [
|
|
{
|
|
"x": 10,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 9,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 8,
|
|
"y": 10
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 18,
|
|
"y": 13
|
|
},
|
|
"seed": 1831565813,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "restart-from-won",
|
|
"args": [
|
|
{
|
|
"width": 20,
|
|
"height": 20,
|
|
"snake": [
|
|
{
|
|
"x": 10,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 9,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 8,
|
|
"y": 10
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": null,
|
|
"seed": 0,
|
|
"score": 7,
|
|
"status": "Won",
|
|
"frame": 0
|
|
},
|
|
{
|
|
"tag": "Restart"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 20,
|
|
"height": 20,
|
|
"snake": [
|
|
{
|
|
"x": 10,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 9,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 8,
|
|
"y": 10
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 18,
|
|
"y": 13
|
|
},
|
|
"seed": 1831565813,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "restart-from-paused",
|
|
"args": [
|
|
{
|
|
"width": 20,
|
|
"height": 20,
|
|
"snake": [
|
|
{
|
|
"x": 10,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 9,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 8,
|
|
"y": 10
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": null,
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Paused",
|
|
"frame": 0
|
|
},
|
|
{
|
|
"tag": "Restart"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 20,
|
|
"height": 20,
|
|
"snake": [
|
|
{
|
|
"x": 10,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 9,
|
|
"y": 10
|
|
},
|
|
{
|
|
"x": 8,
|
|
"y": 10
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 18,
|
|
"y": 13
|
|
},
|
|
"seed": 1831565813,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-below-threshold-only-counts-the-frame",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 0
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 1
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-just-before-threshold-only-counts-the-frame",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 6
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 7
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-at-threshold-ticks-the-game",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 7
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 1,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 8
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-at-second-multiple-of-threshold-ticks-again",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 15
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 1,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 16
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-threshold-shrinks-as-score-grows",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 3,
|
|
"status": "Playing",
|
|
"frame": 6
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 1,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 3,
|
|
"status": "Playing",
|
|
"frame": 7
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-after-threshold-shrinks-does-not-tick",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 3,
|
|
"status": "Playing",
|
|
"frame": 7
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 3,
|
|
"status": "Playing",
|
|
"frame": 8
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-at-top-speed-ticks-every-second-frame",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 18,
|
|
"status": "Playing",
|
|
"frame": 1
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 1,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 18,
|
|
"status": "Playing",
|
|
"frame": 2
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-at-top-speed-odd-frame-does-not-tick",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 18,
|
|
"status": "Playing",
|
|
"frame": 2
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 18,
|
|
"status": "Playing",
|
|
"frame": 3
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-tick-can-end-the-game",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 2,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Playing",
|
|
"frame": 7
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 2,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "GameOver",
|
|
"frame": 8
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-when-paused-is-unchanged",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Paused",
|
|
"frame": 7
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Paused",
|
|
"frame": 7
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-when-game-over-is-unchanged",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "GameOver",
|
|
"frame": 7
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "GameOver",
|
|
"frame": 7
|
|
}
|
|
},
|
|
{
|
|
"name": "frame-when-won-is-unchanged",
|
|
"args": [
|
|
{
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Won",
|
|
"frame": 7
|
|
},
|
|
{
|
|
"tag": "Frame"
|
|
}
|
|
],
|
|
"expected": {
|
|
"width": 3,
|
|
"height": 2,
|
|
"snake": [
|
|
{
|
|
"x": 0,
|
|
"y": 0
|
|
}
|
|
],
|
|
"dir": "Right",
|
|
"nextDir": "Right",
|
|
"apple": {
|
|
"x": 2,
|
|
"y": 1
|
|
},
|
|
"seed": 0,
|
|
"score": 0,
|
|
"status": "Won",
|
|
"frame": 7
|
|
}
|
|
}
|
|
]
|
|
}
|