about summary refs log tree commit diff stats
path: root/tutorial/task12-solution.mu
blob: caf7a935a016519ce45240b79b1152a0988c601f (plain) (blame)
1
2
3
4
5
6
7
8
# Here's one way to draw a rectangle from the top-left corner of screen.
# Lots of other solutions are possible.
fn main screen: (addr screen) {
  draw-line screen, 1/x1     1/y1,     0x300/x2 1/y2,     3/color=green
  draw-line screen, 1/x1     0x200/y1, 0x300/x2 0x200/y2, 3/color=green
  draw-line screen, 1/x1     1/y1,     1/x2     0x200/y2, 3/color=green
  draw-line screen, 0x300/x1 1/y1,     0x300/x2 0x200/y2, 3/color=green
}