Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

SUMMARY OF LOGO COMMANDS (MSW LOGO)

THESE WILL GET YOU STARTED


(remember to press ENTER at the end of each line)
Where abbreviated form is shown whole words may also be used
e.g. forward fd

fd n………….. move forward n steps


bk n…………. move backward n steps
lt n…………... turn left n degrees
rt n………….. turn right n degrees

cs …………… clears screen, puts turtle to Home position(also RESET button)


clean ……….. clears the screen but leaves the turtle where it is on the screen
home ……….. puts turtle to Home position – but leaves lines on screen
(draws line to central position)

ht ……………. hide turtle


st ……………. show turtle

pu or pen up ………….. raises the “pen”. There will be no drawing until…


pd or pen down ………..lowers the “pen”. Pen will draw again.

pe or pen erase …………. Erases as the turtle moves until…


ppt or penpaint…………… Pen draws as normal.

seth 0 ………. Sets the heading of the turtle to zero degrees(bearings=North) wherever it
is on the screen

wait 50……… makes the turtle wait 50 units of time before the next command is followed

Using REPEAT and Building PROCEDURES.

Repeating
There is a REPEAT command which soon turns out to be very useful!
Where a group of commands is repeated several times an abbreviated version can be developed using
the REPEAT command, for example:

Fd 100 Rt 90
Fd 100 Rt 90
Fd 100 Rt 90
Fd 100 Rt 90

Can be summarised as: REPEAT 4[ fd 100 rt 90]


(NB Square brackets.)

Try it and see!

Another example:-
FD10 RT90 FD20 RT90 FD30 RT90
FD10 RT90 FD20 RT90 FD30 RT90
FD10 RT90 FD20 RT90 FD30 RT90
FD10 RT90 FD20 RT90 FD30 RT90

Can be summarised as:


REPEAT 4[FD 10 RT 90 FD 20 RT 90 FD 30 RT 90]

What shape is created?


 In the last examples the list of commands inside the square brackets is a worm.

10

20

30
Altering the numbers produces different worms.
Use REPEAT to find out more about the paths that different worms create.

Our worm was made from three numbers, i.e. 10, 20, 30: you might like to try worms using more or
fewer numbers.

What about changing the angles?

REPEAT is a useful command when drawing regular 2D shapes.


 Can you draw:-
1. a square?
2. a triangle?
3. a hexagon?
4. a pentagon?
5. other regular polygons?
6. a circle?

 Design a border pattern:


e.g. REPEAT 6[RT 45 FD 50 RT 45FD 20 RT 45 FD 50 LT 135]

Animation
 This is essentially drawing, rubbing out, and re-drawing in a slightly different position.
Try this:
REPEAT 30[FD100 BK 100 WAIT 50 PE FD 100 BK 100 WAIT 50 PPT RT 12]

What happened?
What does WAIT do? Try other values?
Can you make the ‘clock’ time 1 minute?

Building procedures

It soon becomes frustrating to keep needing to re-type long lists of commands. But help is hand as
Logo will remember lists of commands If they are entered as a PROCEDURE.

To create a procedure to draw a square:


Type: To square ENTER

A window appears, on the white box type:


Repeat 4[fd 100 rt 90] ENTER

The window remains - now type:


end ENTER.

In the command bar it should now say “Square Defined”.

Now type ‘square’ and press enter.

The square of side 100 will be drawn on the screen.

To change the size of this square:


From FILE on the top toolbar choose EDIT. Select (by highlighting) ‘square’. Press OK.
You can now, in the editor window, change the size of the side.

When ready to leave: from FILE choose SAVE AND EXIT. This will save the changes you have made.

SMALL TIP: Try to make procedure names short e.g. for square “sq” would do. This will save you typing
time later!

Activities with procedures:


Below are a few ideas which may provide a starting point:
Draw:
 A piece of clothing such as a T-shirt
 A house
 A polygon, regular or otherwise
 Spirals

You might also like