Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Question What is a secular trust?

Answered: 1 week ago