You may also like

First Forward Into Logo 1: Square Five

A Short introduction to using Logo. This is the first in a twelve part series.

LOGO Challenge 1 - Star Square

Can you use LOGO to create this star pattern made from squares. Only basic LOGO knowledge needed.

LOGO Challenge 5 - Patch

Using LOGO, can you construct elegant procedures that will draw this family of 'floor coverings'?

First Forward Into Logo 5: Pen Up, Pen Down

Age 7 to 16
Challenge Level

First Forward Into Logo
Previous: FF4

 

This article introduces the idea of a procedure. Procedures allow you to save instructions in LOGO, creating primitives of your own, which you can use elsewhere. Once you have "taught " LOGO what the word "PATTERN" means - it will remember what to do whenever you type in "PATTERN". Providing you save your procedure at the end of you session you can call it up again the next time you wish to do some work.


Consider the following procedure:
TO PATTERN
REPEAT 12 [PU FD 60 PD REPEAT 4 [FD 45 RT 90]PU BK 60 LT 30]
END

What do you think is happening?

The command PU means Pen Up and PD means Pen Down.

Try tracing out the instructions step by step:
* You have something to do - 12 times!
* In doing that something you have to repeat something else 4 times!
Strange ...

Type in the procedure and run it?
ring of squares
Were you right?

Now, try changing different parts of the procedure. Can you anticipate what is going to happen to your diagram in each case?

 


 

Next: FF6