Skip to content
On this page

08ed6ac7 ​

arc
let ls: OList (Int, Int)

let input = fill 9 (fill 9 black)
  |> fold (λ(y, x). vline (-1, -y, x, grey)) ls

let output = fill 9 (fill 9 black)
  |> fold (λ((y, x), i). vline (-1, -y, x, grey
    |> if (i == 1) yellow
    |> if (i == 2) green
    |> if (i == 3) red
    |> if (i == 4) blue
  )) (index (sort (λ(y, x). y) ls))
composer
input = fill 9v (fill 9h black) |> rect ((8 - #2, 8h, 9v, 8h), grey) |> rect ((#0, 4h, 9v, 4h), grey) |> rect ((#1, 2h, 9v, 2h), grey) |> rect ((#2, 6h, 9v, 6h), grey)
output = fill 9v (fill 9h black) |> rect (({#3}, 8h, 9v, 8h), #3) |> rect (({(#7, #4)}, 4h, 9v, 4h), #4) |> rect ((#7, 2h, 9v, 2h), #5) |> rect ((#9, 6h, 9v, 6h), #6)
(VInt, VInt, VInt, Color, Color, Color, Color)
(4v, 2v, 1v, yellow, green, red, blue)
(5v, 8v, 6v, blue, red, yellow, green)
(7v, 2v, 3v, ?, ?, ?, ?)