feat(js): m05 game and m06 view with fixtures and tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
08b462d5cc
commit
b83f94894e
12 files changed
+1398
No files matched your search
@@ -0,0 +1,172 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user