动画

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()

上一篇:Canvas 学习3 (星星)


下一篇:JS练习7——用方向键操控div