ICT in Primary Education

Logo Programming

Aims

In this module you will:

References

Section 2.5 of the 'Professional Standards for Teacher Status and Requirements for Initial Teacher Training' document states that you should " know how to use ICT effectively, both to teach their subject and to support their wider professional role."

Another expectation in the Handbook (S2.5 and S3.3.10) is that "trainee[s] provide opportunities for pupils to use ICT to find things out, try things out and make things happen".

Software Requirements

You will require a web browser for access to some resources and a version of Logo such as Winlogo or Superlogo.

Assessment

Requirements for the assessment of coursework will be clarified by your course tutors and may differ between courses.

Logo Programming: Background Reading

Logo is a programming language specifically designed for education, but differs from Pascal, for example (also described as an 'educational' language) in that it claims to be primarily a 'thinking tool' rather than as an introduction to programming per se.

Originally developed by Seymour Papert at MIT, a number of versions of Logo have subsequently been developed. Papert's early work is broadly 'constructivist' - he writes in his book Mindstorms:

When a child learns to program, the process of learning is transformed. It becomes more active and self-directed. In particular, the knowledge is acquired for a recognizable personal purpose.
By deliberately learning to imitate mechanical thinking, the learner becomes able to articulate what mechanical thinking is and what it is not. The exercise can lead to greater confidence about the ability to choose a cognitive style that suits the problem.
As [the child and the instructor] puzzled together the child had a revelation: 'Do you mean,' he said, 'that you really don't know how to fix it?' ... the incident ... speaks of all the times this child entered into teachers' games of 'lets do that together' all the while knowing that the collaboration was a fiction. Discovery cannot be a setup; invention cannot be scheduled.

Subsequently the team at MIT have described themselves as 'constructionists', stressing the collaborative and 'constructive' aspects of logo. Papert again:

"Constructionism - the N word as opposed to the V word - shares constructivism's connotation of learning as "building knowledge structures" irrespective of the circumstances of learning. It then adds the idea that this happens especially felicitously in a context where the learner is consciously engaged in constructing a public entity, whether it is a sand castle on the beach or a theory of the universe."

Key features of Logo

Key readings on Logo include:

Tasks: Turtle Programming in Practice

These activities are based on practical workshops which I have run with teachers and trainees over the past few years. They don't illustrate all of the features of Logo, but do demonstrate how it can be used not only as a tool to reinforce mathematical concepts but also to encourage theory-building.

You will need to establish which version of Logo you have access to - the instructions below are pretty general, but YMMV*.

* Your Mileage May Vary

Task 8-1: Getting Started

The first set of logo commands which children tend to learn are those concerned with movement and rotation of the onscreen 'turtle':

Command Meaning
FD n foward n units (where a unit is typically either a pixel or a 'turtle' length
BK n back n units
RT n (sometimes R n) Right Turn n degrees
LT n (sometimes L n) Left Turn n degrees
CS Clear screen and return turtle to starting point
HOME Return turtle to starting point without clearing screen
PENUP lift the 'pen' so that the turtle moves without drawing a line
PENDOWN drop the 'pen' so that the turtle draws a line as it moves

You can enter these commands one at a time making the turtle move around the screen. Well done. You've turned a £1000+ computer into an etch-a-sketch machine!

You can draw a small square with this set of commands:

This is a bit repetitive, and happily there is a repeat command - a simple version of the 'FOR' loops used in other computer programming languages. You can achieve the same square by entering a single single command:

You can try the following as well - remember to use PENUP and PENDOWN appropriately:

The last of these may stretch your geometrical thinking a little, for two reasons. Firstly, you have to be able to either calculate the length of the 'third side' in order to get turtle back to the starting point, or alternatively gradually edge your way towards the target point, which is a good estimation exercise (see below):

Turtle Graphics

What mathematical knowledge can you bring to bear on this problem? Although they are related, children tend to solve the 'angles' problem and the 'length of the last side' problem separately.

Hint: what if the turtle's starting point is the right angle of the triangle? Most people - at least initially - make their first rotation 90 degrees, as shown above. Is this the best strategy?

Task 8-2: Drawing Circles

There isn't a built-in command for 'circle' in Logo, so if we want one, we have to use the REPEAT command and a bit of low cunning.

First, as you will probably discover, the smallest rotation available is 1 degree, so in fact our best approximation of a circle will be a n-sided polygon where n is large - 360 is probably the maximum. The basic instruction for a circle is:

Try this out. Now, try and predict what each of the following will give you:

Which of the variables - the number of repeats, the distance forward, or the rotation - controls the size of the circle?

Which variable would you alter to make the turtle go around the same circle more than once? Or make a set of circles like this?

Turtle Circles

For a more challenging task, try and get the turtle to draw circles where its starting point is the centre of the circle. Obviously you'll need to use PENUP and PENDOWN judiciously.

More Turtle Circles

Task 8-4: Polygons

This extends the previous tasks and encourages learners to move from 'ad-hoc' approaches to a theorised, generalisable one. Let's look again at our square and circle (or rather 360-agon) command sequences:

Can we extend our family of regular polygons?

Polygon Sequence
Equilateral Triangle
Square REPEAT 4 [FD n RT 90]
Pentagon
Hexagon
Octagon
Decagon
Dodecagon
360-agon REPEAT 360 [FD n RT 1]

You may find that, as you see the pattern emerging, you can work these out without using the turtle. Remember that using the rotation commands (RT and LT) involve you taking a 'turtle's eye view'. The rotation it undergoes at each corner is not the same as the internal angle (red) or the external angle (blue) of the polygon - but it is easy to derive:

Turtle Graphics

Can you work out a general formula for any polygon? And convert it into a command sequence for the turtle?

Click here for one solution.

Turtle Geometry and Learning about Learning

Examples like those described above clearly show how using Logo can not only reinforce mathematical concepts, but can also encourage learners to think about their learning and the learning of others. One of the most interesting metaphors used by children as they learn logo is that they are 'teaching the turtle' new skills such as drawing circles or other shapes.

In addition, Logo contains a much larger 'vocabulary' than initially seems to be be the case (there are commands which set the pen colour to different values, set the turtle to specific headings, or make it jump to specified locations, for example). Check out the documentation for you particular version for more details.

These two features, combined with the fact that sequences of commands ('procdedures') can be stored as text files and reused at a later stage, providing the turtle with a 'memory' of things learned, can prove an interesting basis to discuss with children their own perceptions of learning.

This can be made explicit: as in the case of a Year 4 teacher whose class used Superlogo over a period of several weeks and who then reviewed the different 'learning' of the different turtles. While some of the children had shared techniques and swapped sequences of code in order to achieve the desired results, different approaches had been used and these had been captured as procedures. By comparing what the turtles 'knew', the teacher was able to illustrate how there were often different ways of solving problems and that in some cases disparate approaches had equal validity.

Floor Turtles

Floor turtles such as Roamer and Pixie provide some of the programming capabilities of screen 'turtles' in floor robots.

These can be used either in structured activities or can be used in 'block play' areas in Early Years settings within which foam or wooden bloack can be used to construct streets, towns, mazes or other settings and the floor robot plays the part of a vehicle, person or animal. See the collection of back issues of 'Go', the Roamer Users' magazine for illustrations of Roamer in action.

Floor robots characteristically lack some of the features of their screen-based relatives: they have very limited onboard 'memory' and so sequences cannot be stored for reuse; and they are unable to report their current position - either relative to their starting point or absolutely relative to a grid of some sort. Such features may appear in future models.

StarLogo and NetLogo

Perhaps the most sophisticated versions of Logo produced to date is the MIT Media Lab's 'StarLogo' and the NetLogo of the Center for Connected Learning at NorthWestern University.

The developers of StarLogo describe it as:

"StarLogo is a specialized version of the Logo programming language. With traditional versions of Logo, you can create drawings and animations by giving commands to graphic "turtles" on the computer screen. StarLogo extends this idea by allowing you to control thousands of graphic turtles in parallel. In addition, StarLogo makes the turtles'world computationally active: you can write programs for thousands of "patches" that make up the turtles' environment. Turtles and patches can interact with one another -- for example, you can program the turtles to "sniff" around the world, and change their behaviors based on what they sense in the patches below. StarLogo is particularly well-suited for Artificial Life projects."

You can look at projects online, watch videos of them in action and examine and borrow bits of source code. Though you may not want to use Starlogo or Netlogo, it is still worth looking here for ideas about using Logo in general - and remember - the best way to learn to program is by trying things out, writing programs and using and reading those produced by other people!

For further discussion of projects with StarLogo and NetLogo, you may find the following useful in that it discusses not only the programming issues but also the pedagogical basis of modelling activities: