import turtle
import random
turtle.pensize(2)
turtle.screensize(800,600)
banjing = 200
jianju = 2
yanse = 'red'
speed = 5
turtle.penup()
turtle.goto(0,-200)
yanseArr = ['red','black','blue','yellow','green','gray','brown','white']
while(1==1):
banjing=random.randint(20,300)
jianju=random.randint(2,banjing)
yanse=yanseArr[random.randint(0,len(yanseArr)-1)]
speed=random.randint(20,40)
turtle.speed(speed)
turtle.pencolor(yanse)
for item in range(0,int(banjing/jianju)):
turtle.goto(0,-200+itemjianju)
turtle.pendown()
turtle.circle(banjing-item
jianju)
turtle.penup()
turtle.clear()
来源:oschina
链接:https://my.oschina.net/u/4286372/blog/4481561