Question: i need help on this code. it gives me the error line: at minesweeper.calculateClues(minesweeper.java:352) Line 352 is for(int c = 0; c < mines[c].length; c++){

i need help on this code. it gives me the error line: at minesweeper.calculateClues(minesweeper.java:352) Line 352 is for(int c = 0; c < mines[c].length; c++){

private void calculateClues() {

int[] arrayOfInt1 = { -1, -1, -1, 0, 0, 1, 1, 1};

int[] arrayOfInt2 = { -1, 0, 1, -1, 1, -1, 0, 1};

for(int r = 0; r < mines.length; r++){

for(int c = 0; c < mines[c].length; c++){

if(mines[r][c] == 9){

for(int t = 0; t < 8; t++){

if((validIndex(r + arrayOfInt1[t], c + arrayOfInt2[t])) &&

(mines[(r + arrayOfInt1[t])][(c + arrayOfInt2[t])] != 9)){

mines[(r + arrayOfInt1[t])][(c + arrayOfInt2[t])] += 1;// add your code here

}

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!