Question: Modify the second walking turtle program in the textbook in section 8.4 so that rather than a 90 degree left or right turn, the angle

Modify the second walking turtle program in the textbook in section 8.4 so that rather than a 90 degree left or right turn, the angle of the turn is determined randomly at each step (0 to 360). In each forward move, change the step from 50 to a number between 75 and 125 (both included), and set the color to red, blue, or green randomly. Also, the turtle turns 180 degrees to the left when it hits the wall. So, if the turtle hits the wall then turn left 180 degrees otherwise turn left at a random angle between 0 and 360 degrees. The program will quit when the turtle hits the wall the third time. You will need to use the turtle module and the random module for this exercise. The code below can be removed or changed as needed.?

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!