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:
Lucas WintherandClaude Opus 5.5 committed 2026-10-29 00:56:27 +01:00
1 parent e27372f017
commit 55f8b0b30f
14 files changed
+435

No files matched your search

+10
View File
@@ -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"