turtle画方框

from turtle import  *
import random
bgcolor("black")
col=["blue","yellow","red","purple","green","white"]
def square(t):
    for i in range(4):
          fd(t)
          lt(90)
#begin_fill()
for i in range(20):
    color(col[round(random.random()*100)%6])
    turtleWidth=(random.random()*100)%6
    square(random.random()*300)
#end_fill()

cnliutz

计算机基础教师

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注