Examples
Draw a square:
forward 10
right 10
back 10
left 10
or:
4.times:
forward 10
turn right
Create a twisting tower:
var
length = 20
height = 50
height.times:
left length / 2
back length / 2
4.times:
forward length
turn right
forward length / 2
right length / 2
turn 5
up 1
Draw randomly:
up 10
forward 10
(50..100).times:
forward 2..5
turn -180..180
up 0..2
Set the color to blue randomly with a 1 in 50 chance. Otherwise set it to white:
if 1 in 50:
color = blue
else:
color = white
or as a one-liner:
color = if 1 in 50: blue else: white
Move forward 10 times, cycling through colors:
10.times:
color = cycle(red, black, blue)
forward 1