Home
Project Folders
Teacher Resources
Student Resources
En ESPAÑOL
How Do I?
Vocabulary
MWForum
Site Map
Search
Our Team

spirals 1 2 3 4 5 6 7 8 9
Spirals 1
Download
5 KB


Goal:   Draw a square-shaped spiral.


Screenshot


Vocabulary:   pd, fd (forward), rt (right), cg

Code
Project Map

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.

  1. In the square-spiral procedure, pd put the turtle's pen down.

  2. 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.

  3. 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.

  4. Make a button and name it square-spiral.  

  5. 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)?


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.





© copyright 2001 - 2016  OpenWorld Learning.   All rights reserved.