Question: Create a flowchart based on the pseudocode given below: First we need to create our turtles, and assign each one to a different color and

Create a flowchart based on the pseudocode given below:

Create a flowchart based on the pseudocode given below: First we need

First we need to create our turtles, and assign each one to a different color and position on the starting line. Each turtle is a different instance of a Turtle , so we Set up game. can do this ! Create a few turtles, each with its own color and position on the We're going to let the race run until a turtle wins by starting line. crossing the finish line. But we need a way to know if a turtle has won. Let's create a variable called winner that is initially set to False, and then set it to True 2 Start the race. when a turtle crosses the line. Set a variable winner to False. While winner is false: Now we're just going to cycle over each A For each turtle: turtle, over and over, letting it make a move - that is , until one of them wins. Pick a random amount to move forward, say between 0 and 2 pixels. To make a move, we'll generate a random Move forward. number between O and 2 and move the turtle by that amount-and we'll do this ii Check to see if turtle's position is across finish line. for each turtle. If so: a Set winner to True. Each time we move we need to check to see if the turtle crossed the 3 Game finishes. finish line . And if so , we'll set winner to True. Announce the winner's name! Once winner is set to True, the loop stops and we'll announce a winner

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!