Turtle graphics - Instructions

Instructions


This applet is adapted from the Turtle Graphics package written by Dr Steve Vickers in 2003 for the Software Workshop 1 in the School of Computer Science, University of Birmingham.

The turtle is the circle with a blob on it. To move it, type a number into the box above the "move" button and then press move as many times as you like. Turning is similar, needing an angle in degrees.

To record a sequence of turtle actions, type in a name for it and press "record", perform some turtle actions and then press "stop and save". To execute a recorded sequence some number of times, select its name, type in the number of repetitions and press "repeat".

How much can you draw yourself?

If you press the "demo" button, you see a collection of shapes. How many can you draw yourself with the turtle?

The easiest are the triangle and square. You can probably draw these just with "move" and "turn".

With more sides it is much easier to use "repeat". First record the move + turn that make a single side, then repeat that the appropriate number of times.

Here's a geometrical question. If someone tells you how many sides they want in a regular figure, how do you work out the angle to turn (in degrees) each time? You are allowed to use decimal fractions if necessary. The final figure in the top line has 15 sides. (Hint: What is the total angle that the turtle turns through in going right round the shape?)

Now see if you can do the stars.

For the circle, draw a figure with 60 sides. That way, the angle turned each time is small enough that the figure looks smooth.

To draw the flower, make a recording of a single petal, and then repeat that 6 times. (Each curved part of a petal is a 60 degrees part of a full circle.)

Finally, here is a tougher challenge. The last drawing in the demonstration is of a 50p coin. Each curved edge is part of a circle whose centre is the opposite corner. (This has the clever consequence that even though a 50p coin is not circular, its diameter is always the same no matter which way you measure it. That comes in handy when people design slot machines.)