RACE
#!/bin/python3
from turtle import *
from random import randint
penup()
speed(0)
goto(-140,140)
for step in range(15):
write(step,align='center')
right(90)
for j in range(15):
forward(5)
pendown()
forward(5)
penup()
backward(150)
left(90)
forward(20)
ada =Turtle()
bob = Turtle()
cim = Turtle()
Dog = Turtle()
ada.shape('turtle')
bob.shape('turtle')
cim.shape('turtle')
Dog.shape('turtle')
ada.color('red')
bob.color('blue')
cim.color('green')
Dog.color('yellow')
ada.penup()
bob.penup()
cim.penup()
Dog.penup()
ada.goto(-150,100)
for i in range(5):
ada.right(360/5)
bob.goto(-150,70)
for i in range(7):
bob.right(360/7)
cim.goto(-150,40)
for i in range(5):
cim.left(360/5)
Dog.goto(-150,10)
for i in range(7):
Dog.left(360/7)
for turn in range(100):
ada.forward(randint(1,5))
ada.pendown()
bob.forward(randint(1,5))
bob.pendown()
cim.forward(randint(1,5))
cim.pendown()
Dog.forward(randint(1,5))
Dog.pendown()
1
网友评论