Python Turtle Graphic Design #12
Source code:
from turtle import *
import colorsys as cs
import time
setup(640,800)
bgcolor('black')
tracer(0,0)
pensize(2)
shape('turtle')
fnt=('Arial',45,'bold')
for n in range(3,21,1):
clear()
goto(0,100)
down()
color(cs.hsv_to_rgb((n-3)/20,1,1))
N = n
A = 360/N
for i in range(N):
for j in range(N):
fd(100-n*3)
rt(A)
rt(A)
up()
seth(90)
goto(0,-320)
color('white')
write(f'Sides: {n}',False,'center',fnt)
goto(0,-250)
update()
time.sleep(1)
done()
No comments:
Post a Comment