Turtle Graphics
One system designed to teach students the basics of computer programming and control, is called ‘Turtle’ Graphics.
A ‘turtle’ is an on-screen object that follows command given to it by the user. As the turtle moves around the screen it drags a ‘pen’ that leaves a trail behind it.
The command language is called ‘LOGO’. LOGO has many commands, but the ones most commonly used are:
A ‘turtle’ is an on-screen object that follows command given to it by the user. As the turtle moves around the screen it drags a ‘pen’ that leaves a trail behind it.
The command language is called ‘LOGO’. LOGO has many commands, but the ones most commonly used are:
FORWARD n | Move forwards n steps |
BACKWARD n | Move backwards n steps |
LEFT n | Turn left n degrees |
RIGHT n | Turn right n degrees |
PENUP | Lift the 'pen' up from the 'paper' |
PENDOWN | Drop the 'pen' down onto the 'paper' |
REPEAT n . . . END REPEAT |
Repeat the commands between these twno commands n times |
Using these commands, any number of shapes and patterns can be drawn. Here are some simple examples...
FORWARD 20
RIGHT 90
FORWARD 10
RIGHT 90
FORWARD 10
LEFT 90
FORWARD 10
RIGHT 90
FORWARD 10
RIGHT 90
FORWARD 20
RIGHT 90
FORWARD 10
RIGHT 90
FORWARD 10
LEFT 90
FORWARD 10
RIGHT 90
FORWARD 10
RIGHT 90
FORWARD 20
LEFT 90
REPEAT 6
FORWARD 10
RIGHT 60
END REPEAT
FORWARD 20
RIGHT 90
FORWARD 10
RIGHT 90
FORWARD 5
PENUP
FORWARD 10
PENDOWN
FORWARD 5
RIGHT 90
FORWARD 10
RIGHT 90
FORWARD 10
RIGHT 90
FORWARD 5
PENUP
FORWARD 10
PENDOWN
FORWARD 5
RIGHT 90
FORWARD 10
This is the story about how the on-screen cursor came to be called a ‘turtle’…
When the LOGO language was first developed, home computers did not have graphical displays – all they could show on the screen was text.
So, instead of an on-screen cursor that moved, the computer was connected to a small buggy which had motors and a pen inside. The computer could turn the motors on or off and so make the buggy move.
The buggy had a plastic dome on top that made it look a bit like a tortoise (or, as Americans would call it, a ‘turtle’)
When the LOGO language was first developed, home computers did not have graphical displays – all they could show on the screen was text.
So, instead of an on-screen cursor that moved, the computer was connected to a small buggy which had motors and a pen inside. The computer could turn the motors on or off and so make the buggy move.
The buggy had a plastic dome on top that made it look a bit like a tortoise (or, as Americans would call it, a ‘turtle’)