?
import turtle as t
t.speed(0)
t.bgcolor("dimgray")
def sibianxing():
t.pu()
t.goto(-90,-120)
t.pencolor("black")
t.fillcolor("white")
t.pensize(2)
t.begin_fill()
t.pd()
for j in range(4):
t.fd(250)
t.circle(80,90)
t.end_fill()
def tuoyuan1(x,y,n,c):
t.pu()
t.goto(x,y)
t.pd()
lenth = 5
t.pencolor(c)
t.begin_fill()
t.fillcolor(c)
for angle in range(0,360,2):
t.seth(angle)
t.fd(lenth)
if 0<=angle<90 or 180<=angle<270:
lenth = lenth - 0.05
elif angle==n:
t.rt(50)
for i in range(3):
t.fd(40)
t.lt(120)
t.lt(50)
continue
else:
lenth = lenth + 0.05
t.end_fill()
def tuoyuan2(x,y,n,c):
t.pu()
t.goto(x,y)
t.pd()
lenth = 4
t.pencolor(c)
t.begin_fill()
t.fillcolor(c)
for angle in range(0,360,2):
t.seth(angle)
t.fd(lenth)
if 90<=angle<180 or 270<=angle<360:
lenth = lenth + 0.04
elif angle==n:
t.rt(45)
for i in range(3):
t.fd(30)
t.lt(120)
t.lt(45)
continue
else:
lenth = lenth - 0.04
t.end_fill()
def yanjing1(r,x,y):
t.pu()
t.goto(x+50,y+120)
t.pd
t.begin_fill()
t.pencolor("darkgreen")
t.fillcolor("darkgreen")
t.circle(r)
t.end_fill()
def yanjing2(r,x,y):
t.pu()
t.goto(x+50,y+100)
t.pd
t.begin_fill()
t.pencolor("dimgray")
t.fillcolor("dimgray")
t.circle(r)
t.end_fill()
sibianxing()
tuoyuan1(0,0,316,"green")
yanjing1(8,0,0)
yanjing1(8,-100,0)
tuoyuan2(100,-50,20,"silver")
yanjing2(6,100,-50)
yanjing2(6,10,-50)
t.ht()
t.exitonclick()
|