Meta: Explora variaciones de espirales con recursión internal.
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
Notas Este proyecto demuestra tres posibles variaciones del procedimiento espiral para obtener efectos interesantes con recursión interna. No existen límites a las posibilidades.
¿Qué pasa si?
Intenta diferentes valores en los controles con estas tres variantes.
Desafío
Crea una o más variaciones por tu cuenta.
|