Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, please i need you to write a Turtle python program that simulates a 100 mete

ID: 3875859 • Letter: H

Question

Hi, please i need you to write a Turtle python program that simulates a 100 meter dash at the Olympics. Your race will have the following features:

Olympic Flag will appear at the top of Turtle screen – must have a white background and the 5 colour rings that appear on the flag

5 turtles racing with each turtle a colour of one of the rings of the Olympic Flag

Your race will be random generated so each time there is a possibility that a different turtle will win

Have all turtles start on a starting line and cross a finish line

Have a countdown of “READY” “SET” “GO” appear on the screen and then the turtles take off

Have the program tell the user which turtle won the race or if it was a tie.

Keep track of how many times each turtle won the race, tie counts as a win.

Keep track of how many times the user guessed right.

allow the user to continue to do the race over and over again until they do not want to do it anymore

When the user choose to exit - Display a new screen and tell them how many times each turtle won a race and how many times they guessed right

Make sure you have a information screen for user explaining the Game.

Make your program screens look nice.

Add any other features you would like, possibilities:

A menu

Change it so you keep track of ties separately and display number of ties that occurred by each turtle. Do not include ties in user’s guessing total but have them as a separate user total. Display tie information to user.

Have the user bet money - like at the horse races. Start off with an amount of money and keeps playing until they want to stop or money runs out.

Explanation / Answer

The python code for the Turtle, explanation given in the comments as #.

from turtle import *
from random import randint
import string
import random
import time, sys
import collections
import turtle

screen = turtle.Screen()
screen.setup(1000, 600)


image = "Desktop/1.png"

screen.addshape(image)
turtle.shape(image)

screen.bgcolor("white")

def main():
while True:

speed(0)
penup()
goto(-140, 140)
  
  
for strep in range(100):#loop to crete strep change to100
write(strep, align='left')
right(90)
for no in range(8):
  
forward(10)
penup()
pendown()
forward(10)
penup()
backward(160)
left(90)
forward(20)
  
a1 = Turtle()# create nuber of variable or turtle
#a1.pensize(10)
  
a1.color("#%06x" % random.randint(0, 0xFFFFFF))
a1.shape('turtle')
  
a1.penup()
a1.goto(-160, 100)
a1.pendown()
  
for run in range(10):
a1.right(36)
  
b1= Turtle()
b1.color("#%06x" % random.randint(0, 0xFFFFFF))
b1.shape('turtle')
  
b1.penup()
b1.goto(-160, 70)
b1.pendown()
  
for run in range(72):
b1.left(5)
  
c1 = Turtle()
c1.shape('turtle')
c1.color("#%06x" % random.randint(0, 0xFFFFFF))
  
c1.penup()
c1.goto(-160, 40)
c1.pendown()
  
for run in range(60):
c1.right(6)
  
d1= Turtle()
d1.shape('turtle')
d1.color("#%06x" % random.randint(0, 0xFFFFFF))
  
d1.penup()
d1.goto(-160, 10)
d1.pendown()
  
for run in range(30):
d1.left(12)
  
def write(text):#fun to write message
w = Turtle()
w.penup()
w.goto(80, 176)
w.color("#FF0000")
w.write(text, None, None, "16pt bold")  
time.sleep(1)
w.clear()
str=['READY','SET','GO']  
  
for x, str in enumerate(str):
write(str)
time.sleep(0.1)
sys.stdout.flush()
guess=input('Who will win.... ?')
  
for run in range(100):#fun to run
ra1=randint(1,10)
rb1=randint(1,10)
rc1=randint(1,10)
rd1=randint(1,10)
a1.forward(ra1)
b1.forward(rb1)
c1.forward(rc1)
d1.forward(rd1)
  
#playername= {'a1': ra1, 'b1': rb1, 'c1': rc1, 'd1':rd1}
correctguess=0
max=max(ra1,rb1,rc1,rd1)
if(max==rb1):
write('Winner is a1, got Gold Medals')
if (max==rb1):
write ('Winner is b1, got Gold Medals')
if (max==rc1):
write('Winner is c1, got Gold Medals')
if (max==rd1):
write ('Winner is d1, got Gold Medals')
ch=input ('Do you want to continue Y/N?')
if(ch=='y'):
turtle.mainloop()
else:
if(guess==max):
correctguess +=1
  
def writewinner(text):#fun to write message
w = Turtle()
w.penup()
w.goto(80, 176)
w.color("#0000FF")
w.write(text, None, None, "16pt bold")  
time.sleep(1)
w.clear()
  
writewinner("the correct guesess are:" )
writewinner(correctguess)
  
  
if __name__ == "__main__":
main()

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote