Skip to content
On this page

03560426 ​

arc
let g: Grid
let rs: OList (Int * Int * Cell)

let input =
  (fold (λ(w, h, c). λ(g, x).
    (rect (x, -1 - h) (x + w, -1) c g, x + w + 1)
  ) rs (g, 0)).0

let output =
  (fold (λ(w, h, c). λ(g, x, y).
    (rect (x, y) (x + w, y + h) c g, x + w - 1, y + h - 1)
  ) rs (g, 0, 0)).0
composer
input = fill 10v (fill 10h black) |> fold (λr. rect ((9v, r.2, 10v, r.3), r.1)) #0 |> fold (λr. rect ((#1, r.2, 10v, r.3), r.1)) #2 |> rect ((#3, #4, 10v, #5), #6)
output = fill 10v (fill 10h black) |> fold (fold rect) #7
(UList (Color, HInt, HInt), VInt, UList (Color, HInt, HInt), VInt, HInt, HInt, Color, OList UList ((VInt, HInt, VInt, HInt), Color))
({(green, 7h, 8h), (red, 4h, 5h)}, 8v, {(blue, 1h, 2h)}, 7v, 10h, 10h, yellow, [{((1v, 1h, 3v, 2h), blue)}, {((3v, 2h, 4v, 3h), red)}, {((4v, 3h, 5v, 4h), green)}, {((5v, 4h, 8v, 4h), yellow)}])
({(red, 8h, 10h)}, 9v, {(orange, 5h, 6h)}, 7v, 1h, 3h, teal, [{((1v, 1h, 4v, 3h), teal)}, {((4v, 3h, 5v, 4h), orange)}, {((5v, 4h, 6v, 6h), red)}])
({(yellow, 1h, 4h)}, 8v, {(green, 8h, 10h)}, 6v, 6h, 6h, red, [{((1v, 1h, 2v, 4h), yellow)}, {((6v, 4h, 8v, 6h), green), ((2v, 4h, 5v, 4h), red)}])
({(green, 8h, 9h)}, 8v, {(fuschia, 6h, 6h), (teal, 3h, 4h)}, 7v, 1h, 1h, orange, ?)