Question: When testing the DrunkardWalk program, you may have noticed that the professor doesnt seem to wander very far from the starting point. This is no
When testing the DrunkardWalk program, you may have noticed that the professor doesn’t seem to wander very far from the starting point. This is no doubt caused by an equal probability of the professor moving in any direction. Modify the program so there is a 50% probability the professor will continue to walk in the same direction as he or she did when taking the previous step. There should be a 10% probability that he or she will reverse direction and a 20% probability that he or she will turn either right or left. Assign a default starting direction before the loop begins.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
