Question: Implement a method setHints (below) that accepts a 2 dimensional array of integers containing - 1s and 0s and modifies it according to the following
Implement a method setHints (below) that accepts a 2 dimensional array of integers containing - 1s and 0s and modifies it according to the following (minesweeper) criteria: to hint of its presence, for each mine (a value - 1) increment by 1 the value of all its surrounding squares ; if another mine exists in one of these squares, its value is left unchanged.
public static void setHints(int[][] array){
//Your code here
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
