Skip to content

Commit 7c2004f

Browse files
committed
Adding a Satisfying Spiral
1 parent afe1f47 commit 7c2004f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Spiral.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import turtle as t
2+
import time as ti
3+
from itertools import cycle
4+
5+
colors = cycle(['red','orange','yellow','blue','green','purple'])
6+
7+
def draw_circle(size,angle,shift):
8+
t.pencolor(next(colors))
9+
t.circle(size)
10+
t.right(angle)
11+
t.forward(shift)
12+
draw_circle(size + 5,angle+1,shift+1)
13+
14+
t.bgcolor('black')
15+
t.speed('fast')
16+
t.pensize(4)
17+
18+
draw_circle(30,0,1)
19+
20+
ti.sleep(3)
21+
t.hideturtle()

0 commit comments

Comments
 (0)