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

spirals 1 2 3 4 5 6 7 8 9
Spirals 4
Try It
47 KB


Goal:   Control a spiral´s angle, tightness, thickness, color, and size.


Screenshot


Vocabulary:   make, setc (setcolor), setpensize

Code
Project Map

to spiral :length
pd
setc whatcolor
setpensize howthick
repeat #turns
[fd :length
rt angle
make "length :length + howtight]
end

to reset
cg
end



Notes

  1. Make the sliders shown on the project map.   Set the minimum and maximums to the numbers indicated on the map.

  2. In the spiral procedure, setc whatcolor means, "Set the turtle's pen color to the number on the whatcolor slider."

  3. Setpensize howthick means, "Set the width of the turtle's pen to the number on the howthick slider."

  4. The number of line segments in the spiral is set by the #turns slider.  

  5. This project uses a different method for increasing the length of the line segments.   (We will not increase the setting on a slider as in Spirals 2 and 3.)   We create the length variable by naming it in the naming line:
    to spiral :length

  6. Now we must supply a value for this variable.   On the spiral button we must include a number.  
    Spiral 10 draws a spiral beginning with a line segment of length 10.   (Choose another number if you like.)
    fd :length moves the turtle forward the value of the length variable.   (When length is worth 10, the turtle will move forward 10 steps.)

  7. Make "length :length + howtight means, "Increase the value of length by the number on the howtight slider."   Be careful of the punctuation! "Length (preceded by a quotation mark) refers to the name of the variable.   :Length (preceded by a colon) refers to the value of the variable (in this case, a number).




What If?
Try different settings on the sliders to create spirals that are tight or loose, thin or thick, small or large, and so on.  


Challenge
Can you make spirals of different angles and tightness that fill the page without "wrapping" over the edge? Keep track of what works.




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