We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2563b8f commit 3436d1eCopy full SHA for 3436d1e
TurtleRace/TurtleRace.py
@@ -1,5 +1,6 @@
1
import turtle as t
2
import random
3
+import time
4
5
scr = t.Screen()
6
scr.setup(width=500, height=500)
@@ -27,9 +28,16 @@
27
28
if runner.xcor() > 230:
29
winner = runner.pencolor()
30
RaceRunning = False
31
+ show = t.Turtle()
32
+ show.hideturtle()
33
+ show.penup()
34
+ show.goto(-200, -150)
35
+ show.color("red")
36
if winner == UserInput:
- print("Your turtle won!")
37
+ show.write("Your turtle won!")
38
else:
- print(f"Your turtle lost, the winner is {winner} turtle!")
39
+ show.write(f"Your turtle lost, the winner is {winner} turtle!")
40
+ time.sleep(1)
41
+ show.clear()
42
runner.forward(random.randint(0, 10))
43
scr.exitonclick()
0 commit comments