Object-Oriented Design Lab
Obstacle Course Program Specification
Design a program to simulate a race through an obstacle course. Racers
start at the starting line and move one space at a time. The race ends
when the first racer crosses the finish line.
Your program should be able to support racers with different movement strategies.
- One type of racer always moves forward. If there's an obstacle in
the way, the racer crashes into it and is out of the race.
- Another moves forward unless that would mean running into an obstacle.
If there is an obstacle in front of it, it always tries moving right, left,
or backward, in that order.
- Another moves forward unless that would mean running into an obstacle.
If there is an obstacle in front of it, it randomly chooses to move right,
left, or backward.
- Another moves randomly, except that it never runs into an obstacle.
- You should come up with at least one other strategy of your own.
Your program should read in an obstacle course configuration. It should
construct a number of racers and place them at the starting line. When
the first racer crosses the finish line, your program should report which racer
finished first, and its winning time.