Meta: Explora variaciones de espirales con recursión internal.
to spiral1 :length :pitch
if :length > howbig [stop]
pd
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
if :length > howbig [stop]
pd
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
if :length > howbig [stop]
pd
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.
Por tu cuenta - Ideas para Proyectos
Ahora que conoces un poquito de recursión interna, crea un nuevo procedimiento con recursión interna. No es necesario que tenga algo que ver con dibujar espirales. Podría usar animación o palabras, por ejemplo.
|