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:
co-authored by
Claude Opus 5.5
parent
e27372f017
commit
55f8b0b30f
@@ -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)
|
||||
Reference in New Issue
Block a user