 |
Spirals 9 |
|
|
Goal: Explore spiral variations with embedded recursion.
to spiral1 :length :pitch
pd
if :length > howbig [stop]
setc whatcolor
setpensize howthick
fd :length rt angle
carefully [note :pitch 3] [ ]
spiral1 :length + howtight :pitch - 1
fd :length lt angle
carefully [note :pitch 3] [ ]
end
to spiral2 :length :pitch
pd
if :length > howbig [stop]
setc whatcolor
setpensize howthick
fd :length rt angle
carefully [note :pitch 3] [ ]
spiral2 :length + howtight :pitch - 1
setc color + 1
fd :length lt angle
carefully [note :pitch 3] [ ]
end
to spiral3 :length :pitch
pd
if :length > howbig [stop]
setc whatcolor
setpensize howthick
fd :length rt angle
carefully [note :pitch 3] [ ]
spiral3 :length + howtight :pitch - 1
rt 180
setc whatcolor + 20
carefully [setpensize howthick - 1] [ ]
fd :length lt angle
carefully [note :pitch 3] [ ]
end
to reset
cg
end
Notes This project demonstrates three possible variations of the spiral procedure to get interesting effects with embedded recursion. There are limitless possibilities.
What If?
Try different slider settings with these three variations.
Challenge
Create one or more variations of your own.
On Your Own
Now that you have learned a bit about embedded recursion, create a new procedure with embedded recursion. It need have nothing to do with drawing spirals. It could use animation or words, for instance.
|