Игра черепашьи бега, работает хорошо, но в конце не знаю как сделать так чтобы выводилось какая черепашка пришла первой, какая второй и какая третьей, спасибо
from turtle import *
from random import *
t = Turtle()
t.penup()
t.goto(-100,100)
t.pendown()
t.speed(0)
for i in range(0,15):
t.write(i)
t.right(90)
t.forward(200)
t.left(180)
t.forward(200)
t.right(90)
t.forward(20)
first=Turtle()
first.shape("turtle")
first.color("red")
first.penup()
first.goto(-120,70)
first.pendown()
second=Turtle()
second.shape("turtle")
second.color("blue")
second.penup()
second.goto(-120,35)
second.pendown()
third=Turtle()
third.shape("turtle")
third.color("yellow")
third.penup()
third.goto(-120,0)
third.pendown()
fourth=Turtle()
fourth.shape("turtle")
fourth.color("green")
fourth.penup()
fourth.goto(-120,-35)
fourth.pendown()
fifth=Turtle()
fifth.shape("turtle")
fifth.color("orange")
fifth.penup()
fifth.goto(-120,-70)
fifth.pendown()
chs = randint(1,10)
sps = ["red", "blue", "yellow", "green", "orange"]
for i in range(0, chs + 1):
chs1 = randint(1,5)
if chs1 == 1:
chs2 = "red"
elif chs1 == 2:
chs2 = "blue"
elif chs1 == 3:
chs2 = "yellow"
elif chs1 == 4:
chs2 = "green"
else:
chs2 = "orange"
bol = Turtle()
bol.shape("turtle")
bol.color(chs2)
bol.penup()
bol.goto(-90+25*i,-120)
bol.pendown()
bol.left(90)
x_first = 0
x_second = 0
x_third = 0
x_fourth = 0
x_fifth = 0
text = input('Прогноз, какая черепаха победит?')
tex = Turtle()
tex.penup()
tex.goto(-120,120)
tex.hideturtle()
tex.write('Ты считаешь, что победит ' + text, font = ('Arial', 12, 'bold'))
while ((x_first<305) and (x_second<305) and (x_third<305) and (x_fourth<305) and (x_fifth<305)):
first_step = randint(1,5)
x_first += first_step
first.up()
first.forward(first_step)
second_step = randint(1,5)
x_second += second_step
second.up()
second.forward(second_step)
third_step = randint(1,5)
x_third += third_step
third.up()
third.forward(third_step)
fourth_step = randint(1,5)
x_fourth += fourth_step
fourth.up()
fourth.forward(fourth_step)
fifth_step = randint(1,5)
x_fifth += fifth_step
fifth.up()
fifth.forward(fifth_step)[/CODE]
from turtle import *
from random import *
t = Turtle()
t.penup()
t.goto(-100,100)
t.pendown()
t.speed(0)
for i in range(0,15):
t.write(i)
t.right(90)
t.forward(200)
t.left(180)
t.forward(200)
t.right(90)
t.forward(20)
first=Turtle()
first.shape("turtle")
first.color("red")
first.penup()
first.goto(-120,70)
first.pendown()
second=Turtle()
second.shape("turtle")
second.color("blue")
second.penup()
second.goto(-120,35)
second.pendown()
third=Turtle()
third.shape("turtle")
third.color("yellow")
third.penup()
third.goto(-120,0)
third.pendown()
fourth=Turtle()
fourth.shape("turtle")
fourth.color("green")
fourth.penup()
fourth.goto(-120,-35)
fourth.pendown()
fifth=Turtle()
fifth.shape("turtle")
fifth.color("orange")
fifth.penup()
fifth.goto(-120,-70)
fifth.pendown()
chs = randint(1,10)
sps = ["red", "blue", "yellow", "green", "orange"]
for i in range(0, chs + 1):
chs1 = randint(1,5)
if chs1 == 1:
chs2 = "red"
elif chs1 == 2:
chs2 = "blue"
elif chs1 == 3:
chs2 = "yellow"
elif chs1 == 4:
chs2 = "green"
else:
chs2 = "orange"
bol = Turtle()
bol.shape("turtle")
bol.color(chs2)
bol.penup()
bol.goto(-90+25*i,-120)
bol.pendown()
bol.left(90)
x_first = 0
x_second = 0
x_third = 0
x_fourth = 0
x_fifth = 0
text = input('Прогноз, какая черепаха победит?')
tex = Turtle()
tex.penup()
tex.goto(-120,120)
tex.hideturtle()
tex.write('Ты считаешь, что победит ' + text, font = ('Arial', 12, 'bold'))
while ((x_first<305) and (x_second<305) and (x_third<305) and (x_fourth<305) and (x_fifth<305)):
first_step = randint(1,5)
x_first += first_step
first.up()
first.forward(first_step)
second_step = randint(1,5)
x_second += second_step
second.up()
second.forward(second_step)
third_step = randint(1,5)
x_third += third_step
third.up()
third.forward(third_step)
fourth_step = randint(1,5)
x_fourth += fourth_step
fourth.up()
fourth.forward(fourth_step)
fifth_step = randint(1,5)
x_fifth += fifth_step
fifth.up()
fifth.forward(fifth_step)[/CODE]