Tutorial #1: Simple Tree
These procedures draw a simple tree in a classic Logo lined style, and a forest of these trees. First, let’s take a look at the tree procedure as a whole.
TO tree :scale
slideleft 8.25 * :scale
forward 20 * :scale
repeat 4 [
slideleft (10 * (5 - repcount)) * :scale
left 30
slideright (12 * (5 - repcount)) * :scale
right 30
]
left 30
slideright 5 * :scale
right 60
slideright 5 * :scale
left 30
repeat 4 [
right 30
slideright (12 * repcount) * :scale
left 30
slideleft (10 * repcount) * :scale
]
back 20 * :scale
slideleft 8.25 * :scale
END
Now let’s go through it a line at a time. The procedure starts out with the procedure declaration TO , then the name of the procedure tree, then a single parameter, :scale