feat(js): m09 input, app, runtime, browser, main, index.html and smoke test
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
584f1d4825
commit
8028bb2fc0
@@ -0,0 +1,160 @@
|
||||
{
|
||||
"function": "keyToAction",
|
||||
"cases": [
|
||||
{
|
||||
"name": "ArrowUp-turns-up",
|
||||
"args": [
|
||||
"ArrowUp"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Up"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "w-turns-up",
|
||||
"args": [
|
||||
"w"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Up"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "W-turns-up",
|
||||
"args": [
|
||||
"W"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Up"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ArrowDown-turns-down",
|
||||
"args": [
|
||||
"ArrowDown"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Down"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "s-turns-down",
|
||||
"args": [
|
||||
"s"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Down"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "S-turns-down",
|
||||
"args": [
|
||||
"S"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Down"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ArrowLeft-turns-left",
|
||||
"args": [
|
||||
"ArrowLeft"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "a-turns-left",
|
||||
"args": [
|
||||
"a"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "A-turns-left",
|
||||
"args": [
|
||||
"A"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ArrowRight-turns-right",
|
||||
"args": [
|
||||
"ArrowRight"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Right"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "d-turns-right",
|
||||
"args": [
|
||||
"d"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Right"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "D-turns-right",
|
||||
"args": [
|
||||
"D"
|
||||
],
|
||||
"expected": {
|
||||
"tag": "Turn",
|
||||
"dir": "Right"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x-is-ignored",
|
||||
"args": [
|
||||
"x"
|
||||
],
|
||||
"expected": null
|
||||
},
|
||||
{
|
||||
"name": "Enter-is-ignored",
|
||||
"args": [
|
||||
"Enter"
|
||||
],
|
||||
"expected": null
|
||||
},
|
||||
{
|
||||
"name": "empty-string-is-ignored",
|
||||
"args": [
|
||||
""
|
||||
],
|
||||
"expected": null
|
||||
},
|
||||
{
|
||||
"name": "space-is-ignored (until m10)",
|
||||
"args": [
|
||||
" "
|
||||
],
|
||||
"expected": null
|
||||
},
|
||||
{
|
||||
"name": "r-is-ignored (until m10)",
|
||||
"args": [
|
||||
"r"
|
||||
],
|
||||
"expected": null
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user