feat(js): m04 random and spawn with fixtures and tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Sonnet 5.5 committed 2026-10-28 23:42:36 +01:00
1 parent 2e39f23bb3
commit 08b462d5cc
11 files changed
+1332

No files matched your search

+73
View File
@@ -0,0 +1,73 @@
{
"function": "newGame",
"cases": [
{
"name": "seed-0",
"args": [
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": 18,
"y": 13
},
"seed": 1831565813,
"score": 0,
"status": "Playing",
"frame": 0
}
},
{
"name": "seed-42",
"args": [
42
],
"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
}
}
]
}