Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (33 sloc) 452 Bytes
square(size, col) {
colour col
repeat 4 {
forward size
right 90
}
}
myrepeat(num, block) {
if num > 0 {
eval block
myrepeat(num-1, block)
}
}
polygon(sides, size, col) {
if sides > 2 {
colour col
angle = 360/sides
myrepeat(sides, {
forward size
right angle
})
}
}
main() {
x = 100
square(x, blue)
penup
left 90
forward 200
right 90
pendown
polygon(10, 25, red)
}
Something went wrong with that request. Please try again.