/// m13 life view: live cells as squares, and a status strip under the board. module Snake.Life.View open Snake.View open Snake.Life.Model let private text x y str align = Text(x, y, str, "#ffffff", 14, align) let private W = LW * LCELL let private H = LH * LCELL let lifeView (state: LifeState) : Scene = [ Rect(0, 0, W, H, "#111111") ] @ (state.Cells |> List.map (fun p -> Rect(p.X * LCELL + 1, p.Y * LCELL + 1, LCELL - 2, LCELL - 2, "#7cb342"))) @ [ Rect(0, H, W, STRIP, "#222222") text 6 (H + 17) $"Generation {state.Generation}" "left" text (W - 6) (H + 17) (if state.Running then "Running: Space pauses" else "Paused: Space runs, N steps") "right" ]