0% found this document useful (0 votes)
126 views8 pages

Logowkshts

This document introduces the LOGO programming language and turtle graphics. It explains that LOGO allows giving a list of instructions to move a turtle around the screen and draw lines. The turtle can be programmed to move forward, turn left or right, and perform other drawing commands. The document provides instructions on starting the LOGO program and contains several worksheets to introduce key LOGO commands like forward, back, repeat, and procedures using variables to draw different shapes based on user input. It aims to teach basic turtle graphics and programming concepts through hands-on exercises.

Uploaded by

MarkCPresley
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views8 pages

Logowkshts

This document introduces the LOGO programming language and turtle graphics. It explains that LOGO allows giving a list of instructions to move a turtle around the screen and draw lines. The turtle can be programmed to move forward, turn left or right, and perform other drawing commands. The document provides instructions on starting the LOGO program and contains several worksheets to introduce key LOGO commands like forward, back, repeat, and procedures using variables to draw different shapes based on user input. It aims to teach basic turtle graphics and programming concepts through hands-on exercises.

Uploaded by

MarkCPresley
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 8

WIN - LOGO

Introduction
What is LOGO?
Logo is a programming language. This means that you can give the computer a list of
instructions that the computer will then carry out. However, it is important that you use
the correct vocabulary, just like any other language, for example French or English.

Turtle Graphics.
What makes Logo different from other computer languages is its ability to handle
drawing commands. To do this it uses something called “Turtle Graphics”. The ‘Turtle’
can be moved around the screen, leaving a trail behind it.

Getting Started
You need to understand that if you give the turtle an instruction, then it will carry it out
straight away, as long as you have used the correct command correctly.

Find the LOGO icon on the desktop, double click it to start the program.

A pop-up window will appear, if you read the information in this box, you will see that
MSWLogo is freeware. This means that the program is free to anybody who wants it. If
you would like a copy for your computer at home, either:

WINDOWS 95/98/ME/NT/2000
1. Fetch a HD disk from home and ask Mr. Presley to copy the program for you.

or

2. If you have INTERNET access then download a copy from


http://www.softronix.com/

50078505.doc 1 25 June 2007


WIN - LOGO
Introduction Continued
When the program has loaded, you will be presented with this screen. This is divided into
2 parts, The Logo screen (the top part) and the Commander (the bottom part).

LOGO SCREEN
This is where your work will appear.

THE TURTLE

COMMANDER SCREEN
This is where you do your work.

Type your instructions in here

The Commander is a window that sits on top of the Logo Screen, it can be moved and
resized just like any other window. If you want to do something straight away, type this
into the long white box at the bottom of the Commander window.

FORWARD 100

Then either press the return key or click on the execute button.

What happened?

You can send the turtle back to where it started from by typing HOME. This moves the
turtle in a straight line to its starting position in the middle of the screen. It will leave any
lines that you have drawn. However, it will also draw a new line from its old position
back to its home position.

You can clear the screen by typing CS.

You can make the turtle go back to where it started from and clear the screen by clicking
the RESET button.

50078505.doc 2 25 June 2007


WIN - LOGO
Worksheet 1
Keywords
FORWARD (FD), LEFT (LT), RIGHT (RT), CS, HOME.
We have already seen that we can make the turtle move by typing commands and executing
(running) them. These words when followed by a number will make the turtle move:
Forward, Left and Right.

Left and Right will make the turtle turn by a given angle, they will not make the turtle move
to the left, or to the right.

Try and Draw this shape (Answer: fd 100


rt 90
fd 100)

Type CS to clean the screen and send the turtle back to its starting position.

Now try and draw these shapes (ask your teacher to check each one as you do it).

MSWLogo page 3

50078505.doc 3 25 June 2007


WIN - LOGO
Worksheet 2
Keywords
BACK (BK), PENUP (PU), PENDOWN (PD), PENERASE (PE),
PENPAINT (PPT), SETPENCOLOR, CLEAN
Here are some new commands to try:

BACK (or BK). This moves the turtle back an amount, it must be followed by a
number.
Moving without drawing
PENUP (or PU). This stops the turtle from drawing so that you can move to
another part of the screen without leaving a line.
PENDOWN (or PD). Makes the turtle start drawing again.
PENERASE (or PE). Allows you to rub out any lines that you have drawn by
mistake. Simply make the turtle move over the line that you
want to rub out.
Try this:
FD 100 RT 90 FD 100
PE
BK 100 LT 90 BK 100
PPT
The turtle must move over the line to rub it out.
PENPAINT (or PPT). Makes the turtle draw again after using PE.
SETPENCOLOR Changes the colour, note the spelling (this is an American
program). You must use it like this:
SETPENCOLOR [COL1 COL2 COL3]
COL1, COL2 and COL3 are numbers between 0 and 255.
CLEAN Rubs out everything on the screen. This does not move the
turtle.

Try these new shapes:

To draw the tunnel:


FD 140 RT 90 FD 140 RT 90 FD 140 RT 90 FD 140 RT 90
PU FD 20 RT 90 FD 20 PD
FD 100 LT 90 FD 100 LT 90 FD 100 LT 90 FD 100 LT 90
PU FD 20 LT 90 FD 20 PD
FD 60 RT 90 FD 60 RT 90 FD 60 RT 90 FD 60 RT 90

50078505.doc 4 25 June 2007


WIN - LOGO
Worksheet 3
Keywords
REPEAT
You can get the turtle to do a lot of the hard work in drawing your pictures. Think about
how you draw a square, you might do this:

FD 100 LT 90
FD 100 LT 90
FD 100 LT 90
FD 100 LT 90

Really you have told the turtle to do this, FD 100 LT 90, four times.

A much quicker way is to use the REPEAT command.

REPEAT 4 [ FD 100 LT 90 ]

Try altering the numbers and see what happens.

You can put repeats inside other repeats, try this:

REPEAT 12 [ FD 100 RT 210 REPEAT 6 [ FD 30 RT 60 ] ]

The repeat command is very good at drawing regular shapes.

Investigate:

What other shapes and patterns can you make using the REPEAT command?

50078505.doc 5 25 June 2007


WIN - LOGO
Worksheet 4
Procedures
A procedure is a program, or a list of instructions that are activated by typing in the name of your
program.

To write a procedure select FILE - EDIT.

If you wish to write a new procedure


then simply type its name in this space,
and then click OK.

To edit or look at an existing procedure click on


its name and then click OK

This box will appear:

The EDITOR screen will then appear.

This is the procedure called


SQUARE. Notice how it starts with the
word TO and finishes with the word
END. All procedures must start with
their own TO and finish with their own
END

When you have finished writing your procedure you can test it or save it.
To save your procedure, do FILE - EXIT. If you have made a mistake, for example missed a bracket out,
then the computer will tell you there is something wrong and give you the chance to try again.

To make your procedure work, just type its name in the Commander window.

Try this procedure and see what happens. Printing


TO SQPAT To print your picture do BITMAP - PRINT
REPEAT 20 [SQUARE RT 18] To print your procedure, from the EDITOR,
END do FILE - PRINT
Write a procedure to draw a circle.
Make a pattern that uses your circle procedure.

50078505.doc 6 25 June 2007


WIN - LOGO
Worksheet 5
Variables

Write procedures to draw 4 squares. The squares should be these sizes 25, 50, 75 and 100.

You probably did something similar to this:

To SQUARE25 To SQUARE50
Repeat 4 [ fd 25 rt 90] repeat 4 [ fd 50 rt 90]
end end

and so on.

However, it is possible to write a procedure that allows you to draw any size square.

From the editor try this:

TO SQUARE :length
REPEAT 4 [ FD :length RT 90 ]
END

Reset the screen and then run the procedure like this:

SQUARE 25
SQUARE 50
and so on.

Note, all we did was replace the number of steps to move e.g. FD 25, with a variable called
:length

(the : is important, it tell the computer it is using a variable). Now when we call square we must
tell the computer how big the square should be. However we can still do better. What’s wrong
now, you ask. Well wouldn’t it be better if we could draw something other than a square, a
triangle?

TO TRIANGLE :length Did you know?


REPEAT 3 [ FD :length RT 120 ] To find the angle to turn
END through all you have to do is
360 divided by the number of
or a pentagon sides.
e.g., 360/3=120
TO PENTAGON :length 360/5=72
REPEAT 5 [ FD :length RT 72]
END

Write a procedure to draw POLYGON :length :sides


(:length is the length of each side and :sides is the number of sides

50078505.doc 7 25 June 2007


WIN - LOGO
Worksheet 6
Assignments – Select 1

1. See what the following commands do, write procedures to show how they can be used.
SETPOS
LABEL
SHOW POS
SETH
SETPC [needs 3 numbers]
SETSC [needs 3 numbers]
SOUND [needs 2 numbers]

2. Write a procedure called HOUSE that draws a house, complete with 4 windows, door,
roof and chimney. Produce a report to show how you completed this task.

3. Write a new procedure called STREET that draws a row of houses. You must tell the
computer how many houses to put in the street. Produce a report to show how you
completed this task.

4. Write a procedure to draw a train. If you finish this with ease, then animate the train
(make it move). Produce a report to show how you completed this task.

5. Draw a dart board using Logo, don’t worry too much about which number goes
where. Produce a report to show how you completed this task.

6. Draw a spiral, it starts in the centre of the screen and works its way out. Produce a
report to show how you completed this task.

7. Write a procedure called TOWER that draws a skyscraper, this should use a variable to
control the height of the tower. Produce a report to show how you completed this task.

50078505.doc 8 25 June 2007

You might also like