C++ language need right now Write a function MoveHare() that takes the position of a hare (on
Fantastic news! We've Found the answer you've been seeking!
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 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.
Posted Date: