| Spirals 1 |
|
|
|
| |
if you cannot see the project |
|
Goal: Draw a square-shaped spiral.
Vocabulary: pd, fd (forward), rt (right), cg
to square-spiral
pd
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
end
to reset
cg
end
Notes 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.
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.
What If?
Try clicking the square-spiral button again after the turtle draws the spiral. Click it five times.
Challenge
Can you make a tighter spiral (with lines closer together)?
|