17. 17
private static int[][] unmaskNeighbours(
MineField mineField, int[][] mask, int[][] newMask,
int cellX, int cellY) {


int startY =

int endY =


int startX =

int endX =



for (int y = startY; y <= endY; ++y) {

for (int x = startX; x <= endX; ++x) {



}

}

return newMask;

}
18. 18
private static int[][] unmaskNeighbours(
MineField mineField, int[][] mask, int[][] newMask,
int cellX, int cellY) {


int startY = Math.max(0, cellY - 1);

int endY = Math.min(mineField.getHeight() - 1, cellY + 1);



int startX = Math.max(0, cellX - 1);

int endX = Math.min(mineField.getWidth() - 1, cellX + 1);



for (int y = startY; y <= endY; ++y) {

for (int x = startX; x <= endX; ++x) {

}

}

return newMask;

}
19. 19
private static int[][] unmaskNeighbours(
MineField mineField, int[][] mask, int[][] newMask,
int cellX, int cellY) {


int startY = Math.max(0, cellY - 1);

int endY = Math.min(mineField.getHeight() - 1, cellY + 1);



int startX = Math.max(0, cellX - 1);

int endX = Math.min(mineField.getWidth() - 1, cellX + 1);



for (int y = startY; y <= endY; ++y) {

for (int x = startX; x <= endX; ++x) {

unmaskCell(mineField, mask, newMask, x, y);

}

}

return newMask;

}