I have made my code as simple to follow as possible and in my head everything works fine and in the code looks OK, but still I get:
- "The countMineNeighbors() method should, for each non-mined cell in the gameField matrix, count the number of adjacent mined cells and assign this value to the countMineNeighbors field."
"It looks like you counted the number of adjacent mines for a cell that is a mine — don't do that."
- The countMineNeighbors() method should use the getNeighbors(GameObject gameObject) method.
- In the createGame() method, after all the elements of the gameField matrix are created, the countMineNeighbors() method must be called.
i don't get it why? Any help?
package com.codegym.games.minesweeper;
public class GameObject {
public int x;
public int y;
public boolean isMine;
public int countMineNeighbors;
public GameObject(int newX, int newY, boolean setMine){
this.x = newX;
this.y = newY;
this.isMine = setMine;
}
}