Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A treasure is hidden someplace the treasures coordinates are (x1, y1)! The coordinates (x1,yl) are determined randomly, using the code that is listed at the
A treasure is hidden someplace the treasures coordinates are (x1, y1)! The coordinates (x1,yl) 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, the y coordinate is decreased by 1. In the same fashion the x coordinate is increased or decreased by 1 depending if the explorer goes East or West, respectively. 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) is distance- sqrt (static_cast
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