海龟画8字

1+

import time
import turtle

turtle.color('red')
turtle.shape('turtle')
turtle.penup()
turtle.bk(200)

for x in range(10):
    turtle.stamp()

while True:
    for x in range(10):
        turtle.fd(20)
        turtle.stamp()
        turtle.clearstamps(1)
        turtle.right(36)
    for x in range(10):
        turtle.fd(20)
        turtle.stamp()
        turtle.clearstamps(1)
        turtle.left(36)
    

1+

发表评论