The ICT Lounge
 
Section 7.4:
Control Applications (Turtle Graphics)
 
Computers can be given sets of instructions which they will follow to control objects on the screen. Giving instructions to a computer is also known as 'programming'.

In this section we will take a look at how a computer can be programmed using a simple language called 'LOGO'.
Key Concepts of this section:
#
Understand how computers can be programmed to 'control' objects on the screen.
#
Know the most common LOGO commands.
#
Be able to use LOGO to draw different shapes by inputting commands.
 

LOGO (aka Turtle Graphics)
What is LOGO?
#


#


#
LOGO (also known as 'Turtle Graphics') was developed in 1967 as a way to teach children basic computer programming.

In LOGO, a curser (called a turtle) can be controlled and moved around the screen by inputting simple commands. As the curser moves around the screen it draws a line.

Common LOGO commands include:

When logo was first released in the 1960's, commands controlled a robot that was shaped like a turtle.
 
Modern versions of LOGO have seen the physical robot turtle replaced with an on-screen curser turtle


 
NOTE!
Using combinations of these commands makes it possible to draw all kinds of different shapes
 

Examples of LOGO in use
#
Here are some examples of LOGO commands being used to draw simple shapes. You will practice drawing each shape in an online version of LOGO which can be accessed by clicking the link in the grey box found on the right of each example.
Example one - a solid shape:
 
Shape to draw
LOGO commands to draw it
 
PENDOWN
FORWARD 60
RIGHT 90
FORWARD 60
RIGHT 90
FORWARD 30
RIGHT 90
FORWARD 30
LEFT 90
FORWARD 30
RIGHT 90
FORWARD 30
 
Click here to open an online version of LOGO and draw the shape to the left
NOTE:
In this version of logo the forward, right and left commands are abbreviated
(Forward = FD, Right = RT, Left = LT)
 
Example two - a shape with gaps:
 
Shape to draw
LOGO commands to draw it
 
PENDOWN
FORWARD 40
RIGHT 90
FORWARD 20
PENUP
FORWARD 10
PENDOWN

FORWARD 20
RIGHT 90
FORWARD 40
RIGHT 90
FORWARD 20
PENUP

FORWARD 10
PENDOWN

FORWARD 20
 
Click here to open an online version of LOGO and draw the shape to the left
NOTE:
In this version of logo the forward, right and left commands are abbreviated
(Forward = FD, Right = RT, Left = LT)
 
     
Example three - using REPEAT n ENDREPEAT:
 
Shape to draw
LOGO commands to draw it
Option 1
Option 2
PENDOWN
FORWARD 30
RIGHT 90
FORWARD 30
RIGHT 90
FORWARD 30
RIGHT 90
FORWARD 30
PENDOWN
REPEAT 4
FORWARD 30
RIGHT 90
ENDREPEAT
NOTE!
Both of the options above will draw the shape to the left. Option 2, however, does it in less steps by using the REPEAT n ENDREPEAT COMMAND
Click here to open an online version of LOGO and draw the shape to the left
NOTE:
In this version of logo the forward, right and left commands are abbreviated
(Forward = FD, Right = RT, Left = LT)
 
 
Example four - your practice shape:
 
Shape to draw
Click here to open an online version of LOGO and draw the shape to the left

Practice drawing it both the long way and using REPEAT n ENDREPEAT

Remember that in this version of LOGO some commands are entered slightly differently
(Forward = FD, Right = RT, Left = LT)

 
Activity!

Click the above task and print all pages. Answer each of the past paper LOGO questions.

Answers to the questions can be found on pages 6 and 7. Check your answers and make any necessary changes.