Question: JAVA, solve this method for a Minesweeper game /** * This method returns the number of mines in the 8 neighboring locations. * For locations

JAVA, solve this method for a Minesweeper game

/**

 * This method returns the number of mines in the 8 neighboring locations. * For locations along an edge of the array, neighboring locations outside of * the mines array do not contain mines. This method does not print out anything. * * If the row or col arguments are outside the mines array, then return -1. * This method (or any part of this program) should not use exception handling. * * @param mines The array showing where the mines are located. * @param row The row, 0-based, of a location. * @param col The col, 0-based, of a location. * @return The number of mines in the 8 surrounding locations or -1 if row or col * are invalid. */ public static int numNearbyMines( boolean [][]mines, int row, int col) { return -99; } 

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!