5.5 More Complex Turtle Graphs

Simple instructions, when combined with looping, can produce quite complex patterns. Consider the following process (with results shown in Figure 5.13):

Galactic Zany!

Figure 5.13: Galactic Zany!

You might enjoy figuring out why this pattern occurs. As you ponder this, it might help to construct a set of “ragged” spirals with somewhat larger steps, and pause at each step. Code like the following might be useful:16

  1. Also don’t forget that every 360 degrees is a full turn around the circle, so when the turtle’s angle is, say 720 degrees, it’s the same as an angle of 360 degrees which is the same as an angle of 0 degrees. All three angles amount to the same direction.