当前位置: 首页 > 工具软件 > Teddy > 使用案例 >

Teddy(嘉恒)最帅 注:我不自恋---(红绿灯)

杨曜瑞
2023-12-01
import turtle
import time
# turtle.fillcolor(red)
# turtle.begin_fill()
turtle.hideturtle()
turtle.pensize(20)
turtle.speed(0)
kuan=300
long=100
turtle.fd(long)
turtle.lt(90)
turtle.fd(kuan)
turtle.lt(90)
turtle.fd(long)
turtle.lt(90)
turtle.fd(kuan)
turtle.lt(90)
# turtle.end_fill()
turtle.penup()
turtle.goto(50,250)
turtle.dot(70,'red')
wait = 0.5
bgcolor = "white"
time.sleep(wait)
turtle.dot(70,bgcolor )
time.sleep(wait)
turtle.dot(70,'red')
time.sleep(wait)
turtle.dot(70,bgcolor )
time.sleep(wait)
turtle.dot(70,'red')
time.sleep(wait)
turtle.dot(70,bgcolor )

time.sleep(wait)
turtle.penup()
turtle.goto(50,150)
turtle.dot(70,'yellow')
time.sleep(wait)
turtle.dot(70,bgcolor )
time.sleep(wait)


turtle.penup()
turtle.goto(50,80)
turtle.dot(70,'green')
time.sleep(wait)
turtle.dot(70,bgcolor )
time.sleep(wait)
turtle.dot(70,'green')
time.sleep(wait)
turtle.dot(70,bgcolor )
time.sleep(wait)
turtle.dot(70,'green')
time.sleep(wait)
turtle.dot(70,bgcolor )
time.sleep(wait)
turtle.dot(70,'green')
time.sleep(wait)
turtle.dot(70,bgcolor )
time.sleep(wait)
turtle.dot(70,'green')
time.sleep(wait)
turtle.dot(70,bgcolor )

turtle.penup()
turtle.goto(-300,10)
turtle.write('嘉恒最帅',font=(None,150))
turtle.done()







 类似资料: