Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+5 votes

I am able to make my owls move. However, now at the beginning of each new race, my owls start where they left off in the previous race. What should I add or fix to get my owls to start from the start line again?

asked in CSC201 Spring 2021 by (8 points)

Great, I fixed it! Thanks everyone!

6 Answers

+5 votes

For me, I will set the variable which is used to display the number of “.” to equal 0

For example:

For race in range(...):
   Furlong1 = 0
   Furlong2 = 0
   For furlong in range(..):

Using this the owl will start again from the beginning after each race.
I don't know what approach that you use to make the owl move but that what I do to restart the owl race. So let me know if you need more help or don't quite understand.

answered by (8 points)
+5 votes

Define your variable for the amount of dots in the loop for the races and then add to the dots in the loop for the minutes.

answered by (8 points)
+4 votes

You have to put them inside their own loop. You have to "nest" your owls inside your first loop.

answered by (508 points)
+4 votes

It could be you don't reset the distance accumulator of your owls at the end of the last race. If you set them at the end of the loop of each race it would fix the problem.

answered by (8 points)
+2 votes

By using the for ... in range loop, you reset your owl after every race to 0 (by declare a variable before it)

answered by (8 points)
0 votes

Check whether your print statement is in the loop or not. It should not be in the loop so that you could reset the race

answered by (8 points)