🌈
Rainbow spiral
Sixty growing lines, cycling through six colours, twisted just off-symmetric.
Builder· ages 10–1220 minfor loopslist indexingmoduloturtle graphics
spiral.py
520×520
First load pulls ~10 MB of Python. Only happens once — the browser caches it after.
What should the output look like?
A colourful spiral fanning out from the center.
📖
How this works
60 lines are drawn. Each is a little longer than the last (i * 3), and after each we turn 59° — one degree off from a hexagon's 60°. That tiny offset is what makes it spiral instead of closing into a shape.
Your turn — try these
- 1Change the 59 to 60. What happens? Now try 58.
- 2Speed it up: change `i * 3` to `i * 5`.
- 3Add a second loop below that draws the same spiral, but starting from the other direction.