feat(fsharp): m09 input/app/runtime and m10 extensions with tests

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Lucas Winther
2026-10-29 00:56:27 +01:00
co-authored by Claude Opus 5.5
parent e27372f017
commit 55f8b0b30f
14 changed files with 435 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
/// Test helpers shared by the m09, m10 and m11 suites.
module Snake.Tests.M09Helpers
open Snake
open Snake.View
open Snake.IO
open Snake.Stream
/// The m09 program built from classicActions (ticks every 150 ms). The shipped `main` switches to speedActions in m10.
let classicMain () : IO<Stream<IO<unit>>> =
IO.randomSeed () |> IO.map (fun seed -> App.states seed App.classicActions |> Stream.map App.render)
/// The shapes an IO draws, in order (interpreted by `IO.trace`).
let drawn (io: IO<unit>) : Shape list =
(IO.trace 0u io).Ops
|> List.choose (fun op ->
match op with
| Draw shape -> Some shape
| RandomSeed -> None)