feat(fsharp): m09 input/app/runtime and m10 extensions with tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e27372f017
commit
55f8b0b30f
14 files changed
+435
No files matched your search
@@ -0,0 +1,10 @@
|
||||
/// m09 input: from keyboard keys to game actions.
|
||||
module Snake.Input
|
||||
|
||||
open Snake.Model
|
||||
|
||||
/// Translate a keyboard key name (as in the browser's `KeyboardEvent.key`) into the action it triggers, if any.
|
||||
/// m09: "ArrowUp"/"w"/"W" -> `Some (Turn Up)`, "ArrowDown"/"s"/"S" -> Down, "ArrowLeft"/"a"/"A" -> Left,
|
||||
/// "ArrowRight"/"d"/"D" -> Right. Any other key -> `None`.
|
||||
/// (m10) " " (Space) -> `Some TogglePause`, "r"/"R" -> `Some Restart`.
|
||||
let keyToAction (key: string) : Action option = failwith "TODO m09"
|
||||
Reference in new issue
Block a user