Functions can used just like built-in commands, and we can build complex functions out of other functions.
After a function is defined, it can be
pen brown twig = -> fd 20 dot green bk 20 do twig
A function can be called from anywhere, including inside other functions. Functions work just like built-in commands.
# (add to the program above) branch = -> fd 20 lt 30 do twig rt 60 do twig lt 30 bk 20 do branch
Here is a function that uses a function that uses a function.
# (add to the program above) tree = -> fd 50 lt 30 do branch rt 60 do branch lt 30 bk 50 do tree
You can attach functions to buttons or clicks. Try using a function to make an intricate shape inside a drawing program.