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) 

You must log in to read the rest of this article. Please log in or register as a user.