173 lines
3.0 KiB
JSON
173 lines
3.0 KiB
JSON
{
|
|
"function": "replay",
|
|
"cases": [
|
|
{
|
|
"name": "twelve-actions-eat-one-apple",
|
|
"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
|
|
},
|
|
[
|
|
{
|
|
"tag": "Turn",
|
|
"dir": "Up"
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
},
|
|
{
|
|
"tag": "Turn",
|
|
"dir": "Left"
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
},
|
|
{
|
|
"tag": "Tick"
|
|
}
|
|
]
|
|
],
|
|
"expected": {
|
|
"width": 20,
|
|
"height": 20,
|
|
"snake": [
|
|
{
|
|
"x": 1,
|
|
"y": 9
|
|
},
|
|
{
|
|
"x": 2,
|
|
"y": 9
|
|
},
|
|
{
|
|
"x": 3,
|
|
"y": 9
|
|
},
|
|
{
|
|
"x": 4,
|
|
"y": 9
|
|
}
|
|
],
|
|
"dir": "Left",
|
|
"nextDir": "Left",
|
|
"apple": {
|
|
"x": 6,
|
|
"y": 5
|
|
},
|
|
"seed": 3663131668,
|
|
"score": 1,
|
|
"status": "Playing",
|
|
"frame": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "no-actions-returns-the-start",
|
|
"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
|
|
},
|
|
[]
|
|
],
|
|
"expected": {
|
|
"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
|
|
}
|
|
}
|
|
]
|
|
}
|