Question
C++ language need right now Write a function MoveHare() that takes the position of a hare (on a 71-character race track assuming track[0] is the
C++ language need right now
Write a function MoveHare() that takes the position of a hare (on a 71-character race track assuming track[0] is the starting gate and track[70] is the finish line) and updates (NOTE: not returns) that position moved according to the following rules: 20% probability of hare sleeping, 20% probability of big jump to right (9 places), 10% probability of big slip downhill (-12 places), 30% probability of small hop to right (2 places) and a 20% probability of small slip to left (-2 places). Assure that the hare does not move beyond the finish line or back into the starting gate. Program for efficient code execution and easy maintenance.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started