Procedures are simply sets of commands.
As with all LOGO, there are formalities to be observed. Consider the following procedure:
TO HEXAG
REPEAT 6 [FD 80 RT 60]
END
(note the first and last lines. The first line starts “TO” followed by the name of the procedure. The last line simply contains the word “END”.)
Look at the procedure above and imagine what is happening. Explain what you 'see' to someone.
Test out your thoughts. Were you right?
Once you have created a procedure LOGO will remember that command. In the case above LOGO now knows how to "HEXAG". so now you can use the word "HEXAG" in another context and LOGO will automatically do what you have taught it.
So now consider this procedure:
TO PAT
REPEAT 5 [HEXAG RT 72]
END
Again, imagine what is happening. Explain what you 'see' to someone.
Now, test out your thoughts.
As you can see the "HEXAG" procedure has been embedded into another procedure. There is no limit to how many procedures you can "embed" inside another procedure.
In light of these additions to your drawing capabilities, consider some of the following challenges:
Squares to procedures (Extras 2) gives you some room to practise your new found knowledge and challenges 3 and 4 stretch you a little further.
Don't forget to consider how succinctly you can write the code.