python创意绘画蓝色的扫把

"""蓝色的扫把"""

import turtle
from random import randint

screen = turtle.getscreen()
screen.title("python蓝色的扫把")
screen.delay(0)
screen.setup(480,480)
screen.mode("logo")

turtle.ht()
turtle.bk(50)
turtle.pensize(1)
turtle.pencolor("blue")

# 设定-45到45之间的一个方向, 设定要移动的距离,前进x,倒退x
screen.tracer(0)
for i in range(1000):
    turtle.seth(randint(135,225))
    x = randint(100,120)
    turtle.fd(x)
    turtle.bk(x) 

turtle.goto(0,-50)
turtle.color("brown")
turtle.pensize(5)
turtle.setheading(0)
turtle.fd(200)
turtle.color("blue")
turtle.penup()
turtle.goto(0,180)
turtle.write("蓝色的扫把by李兴球",font=("",12,"italic"),align='center')
screen.update()

screen.mainloop()

python创意绘画蓝色的扫把by李兴球