Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions