Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

3. Provide advice on how to help a plateaued employee.

Answered: 1 week ago