I need to make a simple(standart) minesweeper for my project.
I want to check the surrounding elements of a random(or specific) element of a 2d array.

lets say I have an array like that

```
boolean board[5][5]

```

I want to check the surrounding elements of 

`board[0][0]`

I wrote that:

```
    public int numberChecker(int h, int w) {
    int checker = 0;        
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            int he = h - 1 + i;
            int wi = w - 1 + i;    <---- this i should be j that was the issue
            if (board.getHeight() > he && he >= 0 
                               && wi >= 0 && board.getWidth() > wi) {
            if (boomChecker(he, wi)) {
                if (w != (wi) && h != (he)) {
                    checker++;
                }
                }
            }
        }
    }                                   

    return checker;
}

```

the problem is I think it only checks **" \ "** way (do not know how to put it in words)

ex:

(output # means uncovered numbers mean surrounding mines)

uncover 4-2

```
######
######
0#####
#0####
##0###     <-- unlocking this one
###0##

```

or 

uncover 0-0

```
0#####
#0####
##0###
######     <-- there is a mine at check spot
######
######

```

the code itself is not important (I know I made it a bit complicated to explain myself)

all I need is a working surrounding checking for loop (or anything)

thanks in advance

Problem solved 
simple stupid mistake 
 int he = h - 1 + i;
 int wi = w - 1 + i; <--- i should be j
thanks