Question: PLS HELP ME IN python 3 Step 1: Create the running track Look over your notes from last workshop and create a python file called

PLS HELP ME

PLS HELP ME IN python 3 Step 1: Create the running track

IN python 3

Step 1:

Create the running track

Look over your notes from last workshop and create a python file called turtlerace.py which will contain the vertical lines and number them from 0 14 (15 tracks). The distance between each track is 10 units. First figure out how to draw one vertical line and then use a for loop to complete creating a track of 15

.Look over your notes from last workshop and create a python file

Hint As we have 15 lines to draw, reposition the cursor from the middle of the screen to another coordinate on the screen. Screen coordinates are indicated by x an y coordinate. For all the lines to be visible on your screen add the line goto (-140, 140) before you start drawing the lines. You can also speed up the cursor if you want to.

Step 2:

Racing Ada

Now for the fun bit. Lets add some racing turtles. It would be really boring if the turtles did the same thing every time so they will move a random number of steps each turn. The winner is the turtle that gets the furthest in 100 turns.

Step 2a)

Create a turtle using the shape() and call it ada. Ada is red in color and ada starts the race from the location (-160,100). Use the goto() to assign Ada her starting position.

Step 2b)

Now you need to make the turtle race by moving a random number of steps at a time. Youll need the randint function from the Python random library. Add this import line to the top of your script.

The randint function returns a random integer (whole number) between the values chosen. The turtle will move forward 1, 2, 3, 4, or 5 steps at each turn.

Step 3:

Race Ada, Grace, Katherine and Shafi

Use the same for loop that you created to race Ada to race all the other turtles. Pick your favorite colors for all the three turtles. https://trinket.io/docs/colors This link should give you a list of all the colors.

Step 5:

Before the race begins make your turtle twirl (Turn 360 in one place) at the starting line.

There is no twirling function in Python so you have to write your own. Think about how your turtle can turn 36 degrees over 10 steps without moving from their initial position!

Step 6:

Let the turtle all turn at different directions, so maybe Ada starts from the left turns 36 degrees for 10 steps or Grace turns right every 6 degrees for 60 steps. Use your active imagination!

Step 7 (The most important)!

The names of your turtles have a special significance, can you guess what that is? If you can then find out more about them and on top of your code add 1 line about each of them.

Step 8:

The track Change the vertical lines from solid to dashed. You can do this by using the penup () and pendown() fucntions.

0 1 2 3 45 6 7 8 9 10 11 12 13 14 0 1 2 3 45 6 7 8 9 10 11 12 13 14

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 Databases Questions!