public void uncover(int row, int col) { // TODO Auto-generated method stub if (!cellmat.thereIsUncovered(row, col)) { if (cellmat.thereIsMine(row, col)) { gameover = true; } else { if (cellmat.getNumber(row, col) == 0) { int[][] binmatrix = new int[rowmat][colmat]; for (int i = 0; i < rowmat; i++) { for (int j = 0; j < colmat; j++) { if (cellmat.thereIsMine(i, j)) { binmatrix[i][j] = 1; } else { binmatrix[i][j] = 0; } } } Set<Matrix2DCellPosition> mat2d; mat2d = MatrixUtils.cascade(binmatrix, row, col); for (Matrix2DCellPosition matrix2dCellPosition : mat2d) { cellmat.uncoverCell(matrix2dCellPosition.getRow(), matrix2dCellPosition.getColumn()); } } else { cellmat.uncoverCell(row, col); } } } }
public void displayRaw() { // TODO Auto-generated method stub for (int i = 0; i < rowmat; i++) { for (int j = 0; j < colmat; j++) { if (cellmat.thereIsMine(i, j)) { System.out.print("1"); } else { System.out.print("0"); } } System.out.println(); } }