Question
The Great Race Simulation Recreate the great race between the tortoise and the hare using pointers. Using a race course of size 70 where the
The Great Race Simulation Recreate the great race between the tortoise and the hare using pointers. Using a race course of size 70 where the race course is an array and the tortoise location is represented by a T and the hare is an H simulate the race one minute at a time by advancing the tortoise and hare using pointers. The two racers move in different ways based on random selection of different types of moves. Tortoise moves: Hare moves: 50% 3 steps forward 20% sleep (no move) 30% 1 step forward 20% 9 hops forward 20% 6 steps back 10% 12 hops back 30% 1 hop forward 20% 2 hops back The racers locations each minute of the race will be captured and recorded and should look something like this: Start Finish
|-------------------H--------T---------------------------------------------------------------------------------|
|------------------------H----T--------------------------------------------------------------------------------|
|-------------------------------OUCH!!!---------------------------------------------------------------------| In the event (except at the start) if the tortoise and hare end up on the same spot you the race course should display the word OUCH!!! First racer to cross the finish line is the winner and when that happens your program should say so.
C++
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