Goal: Draw a square-shaped spiral.
Vocabulary: pd, fd (forward), rt (right), cg
fd 10 rt 90
fd 15 rt 90
fd 20 rt 90
fd 25 rt 90
fd 30 rt 90
fd 35 rt 90
fd 40 rt 90
fd 45 rt 90
fd 50 rt 90
fd 55 rt 90
fd 60 rt 90
fd 65 rt 90
This project creates a square-shaped spiral, line by line.
- In the square-spiral procedure, pd put the turtle's pen down.
- Each new command in the square-spiral procedure tells the turtle to move forward (fd) an increasing number of steps and turn right (rt) 90 degrees. The commands repeat but the number of steps vary.
This method works, but it is a lot of trouble to write out the commands for every turtle movement! The other projects in this folder will show a variety of ways to create spirals with just a few lines of code.
- In the reset procedure, cg stands for "clear graphics." It erases the turtle's drawng and places the turtle back at the center of the page with its head up.
- Make a button and name it square-spiral.
- Make a reset button.
Try clicking the square-spiral button again after the turtle draws the spiral. Click it five times.
Can you make a tighter spiral (with lines closer together)?
On Your Own - Project Ideas
Can you make a simple picture using just the square-spiral button? You may drag the turtle wherever you like.