Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 45b2e24

Browse files
Update Kaleido-spiral.py
1 parent abf4941 commit 45b2e24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎Codes on Turtle Graphics/Kaleido-spiral.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
import time as ti
33
from itertools import cycle
44

5-
colors = cycle(['red','orange','yellow','blue','green','purple'])
5+
colors = cycle(['red','orange','yellow','blue','green','purple'])# create circles and squares of different colors
66

77
def draw_circle(size,angle,shift,shape):
88
t.pencolor(next(colors))
99
next_shape = ''
1010
if shape == 'circle':
1111
t.circle(size)
12-
next_shape = 'square'
12+
next_shape = 'square'# draw next shape as square after circle
1313
elif shape == 'square':
1414
for i in range(4):
1515
t.forward(size * 2)
@@ -20,7 +20,7 @@ def draw_circle(size,angle,shift,shape):
2020
draw_circle(size + 5,angle+1,shift+1,next_shape)
2121

2222
t.bgcolor('black')
23-
t.speed('fast')
23+
t.speed('fast')# to create the figure fastly
2424
t.pensize(4)
2525

2626
draw_circle(5,0,1,'circle')

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /