Question: Use nested for loops to loop through the blocked array. The outer index variable is the row, the inner index variable is the column. Read

Use nested for loops to loop through the blocked array. The outer index variable is the row, the inner index variable is the column.
Read the file one character at a time using the next() function (not nextLine()).
Read in the fext character in the inner for loop.
If the character is a 1, set the corresponding location in the blocked array to true.
If the character is a 0, set the corresponding location in the blocked array to false;
If the character is an S, set the location of the start and player, since the player starts at the starting location.
If the character is a G, set the location of the goal.
This would be a great place to use a switch statement, although you are not required to.
The tests for both constructors should pass now. In java
 Use nested for loops to loop through the blocked array. The

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!