Monday, Oct. 11, 1982

Easy Does It

To teach the triangular Logo turtle a new command--in effect, to write a computer program--the child simply types the word TO followed by some step-by-step instructions. For example, here is a program that tells the computer to draw a circle on the screen:

TO CIRCLE

REPEAT 360 [RIGHT 1 FORWARD 1]

END

The word END tells Logo that the definition is complete. Logo responds by typing CIRCLE DEFINED. The next time the computer sees the command CIRCLE, it will locate a copy of the definition and start executing the instructions it contains. Repeating the commands within the brackets, it makes one tiny right turn and takes one tiny step forward, 360 times in a row. This linking of 360 tiny straight-line segments, as any calculus student or Logo child will tell you, produces a perfectly acceptable approximation of a circle. CIRCLE can then be combined with other commands to produce flowers, faces, anything at all.

This file is automatically generated by a robot program, so viewer discretion is required.