Which turtle can reach the finish line first?
★★★With multiple turtles and a random forward movement, a race can be simulated.
Write a program that runs a race of up to 8 turtles moving up the screen 240 pixels from a starting position. Each turtle can move between 0-10 pixels in each turn. All the turtles will finish the race, but once a turtle has reached the finish line it will stop moving. The results of the race should be output.
Remember to add a comment before a subprogram, condition or iteration to explain its purpose.
racing_turtles are created. For each turtle it:
silk constant. E.g. turtle 0 is red, turtle 1 is blue etc.t.position.draw_finish_line that:referee that moves up the screen to the finish_line.draw_finish_line subprogram is called.starters_orders subprogram is called.race subprogram is called.starters_orders that:race that:speed if it has not already finished the race.
Results: 1 : salmon 2 : purple 3 : blue 4 : green 5 : red 6 : orange
Restricted automated feedback
Automated feedback for this assignment is still under construction. Submitted programs are checked for syntax errors and their source code is checked for potential errors, bugs, stylistic issues, and suspicious constructs. However, no checks are performed yet to see if the program correctly implements the behaviour specified in the assignment.