Question: Pleae help thanks. 3. Write a program (race.py) that is simulating a race between the four Ninja turtles (Leonardo, Donatello, Michelangelo and Raphael) using the
3. Write a program (race.py) that is simulating a race between the four Ninja turtles (Leonardo, Donatello, Michelangelo and Raphael) using the turtle module. Each turtle should move across the screen from left to right, a random number of pixels (between 20 and 50), at each round. The turtle that crosses the finish line first, will be the winner -The four turtle objects should be named: leo, donnie,mickey and raph and should be represented with turtles of blue, purple, orange and red color respectively. -in each round, each one of the four turtles makes one "move" In each round, each turtle can move a random number of steps(pixels) in the range 20 through 0 (inclusive). -The race track is 500 pixels long and the starting pasition for the four turtles is at the coordinates shown below: o leo o donnie o nickey : starts at position (-300, 100) starts at position(-300, 50) : starts at position (-300, ) starts at position -300, -50) The winner of the race is the Ninja turtle that crosses first the finish line [remember the race rack is 500 pixels long). After all turtles have crossed the finish line, your program should be printing on the canvas (below the race track] the winner of the race (assuming leo) with a message similar to the one shown below Ladies and Gentlenen we have wirner! Leo you are the ultinate winner of the race! Note: You cannot use user-defined functions for this onel Implementation phases It is a good idea to start from a very simple version of this problem first (one turtle) and then work on more complicated versions (two turtles) until you reach the requested one (four turtles). You can start executing the following steps: - Create one turtle object as shown in class - Change its shape to a "turtle - Change the color of the turtle Move the turtle to its starting pasition -Start moving the turtle towards the finish line " Check if the turtle crossed the finish line or continue to next round (Hint: turtle has walked the whole distance up to the finish line?) - Then, update the code for two turtles. Then, update the code for four turtles
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
