Question: Submit each java file electronically through Campus Cruiser by the due date. Submit a printout of your source code to the instructor by the due
Submit each java file electronically through Campus Cruiser by the due date. Submit a printout of your source code to the instructor by the due date Write in Java Code Your task is to write a program that starts with an initial starting point and a map of a cave. It then finds as much treasure in the cave as possible by exploring all the accessible locations. Every time you encounter treasure, your program will output the path you took from the starting point to the treasure. Every time you reach a you will retrace your steps and try another of the untried paths until you back to your starting point having explored all the paths accessible to you. Once the program has explored all accessible spots on the m it stops. Details: 1. No matter where you are in the cave, you can only travel in one of the four cardinal directions, north (up), south(down east (right) and west (left) W me E 2. Because the position on the map is a location (row, you should use a compound data structure to represent this position. The data structure you will u is a two-dimensional array. 3. When you have multiple path options, it could simplify your algorithm if you alw try the available paths in exactly the same order (such as always first look to the north, then to the west, then to the south, and finally to the east). 4. The maps have paths marked by a walls marked by a 'W', treasure mark by a 'T', and your position is marked by a 'x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
