Question: This method reads a maze file and sets up the corresponding fields accordingly. Since it is reading from a file, it can throw a FileNotFoundException,
This method reads a maze file and sets up the corresponding fields accordingly. Since it is reading from a file, it can throw a FileNotFoundException, which must be declared since we have not learned about catching exceptions yet.
First, it should create our five array fields: blocked, visited, player, start, and goal. Initialize them to empty dimensional or dimensional depending on the field arrays of appropriate sizes. After creating these arrays in loadMaze, all of the tests for the getters and setters should pass consider why
Next, you will need to open the maze file using a Scanner, read in the data, and set values accordingly. In java
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
