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 7
Screenshot
Turtle Face Get Web Player
  if you cannot see the project


Goal:   Change conditions at intervals.




Vocabulary:   color, pensize

Code
Project Map

to changing_spiral
make "count 1
setc whatcolor
setpensize howthick
spiral 10 110
end

to spiral :length :pitch
pd
if :length > howbig [stop]
make "count :count + 1
if :count > interval
[setc color + 1
setpensize pensize + 1
make "count 1]
fd :length rt angle
carefully [note :pitch 3] [ ]
spiral :length + howtight :pitch - 1
end

to reset
cg
end



Notes

In this project, the color and line thickness change only at intervals which we set with the interval slider.  

  1. We will use a new variable called count to keep track of the intervals.   We need to give count a starting value of 1.   So this project uses a new procedure called changing_spiral to set the starting values of count, color, and pensize.   Then it calls the spiral procedure (which has two inputs in this project).

  2. When the value of count becomes greater than the number on the interval slider, three things happen:

    setc color + 1 means: increase the turtle's color by 1;
    setpensize pensize + 1 means: increase the line thickness by 1;
    make "count 1 resets the value of count to 1.

    So while length and note change every time spiral is called, the color and line thickness change only at the interval set on the interval slider.




What If?
Try different settings on the interval slider.  


Challenge
Can you modify the project so that the angle changes size at intervals? (See Squares 6.)




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