Question: Help with this problems in c++ language Thanks Exercise #5: Treasure Hunt A treasure is hidden someplace-the treasures coordinates are (x1,?! The coordinates (x1.yi) are
Exercise #5: Treasure Hunt A treasure is hidden someplace-the treasures coordinates are (x1,?! The coordinates (x1.yi) are determined randomly, using the code that is listed at the end of this exercise. The purpose of the game is for the Explorer to find the Treasure! The explorer is allowed to go North, South, West or East. The Explorer is first positioned at location (15,15). If the explorer goes North, only the y coordinate is increased by 1. Similarly, if the explorer goes South, they coordinate is decreased by . In the same fashion the x coordinate is increased or decreased by 1 depending if the explorer goes East or West, Each time the Explorer moves, the distance between the Explorer and the treasure is computed. The formula for the distance between (x.y) and (x1,y1) sqrt(static_cast
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
