/
Lab9.java
69 lines (53 loc) · 1.21 KB
/
Lab9.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
public class Lab9 {
public static void addTo10(int [][] array) {
int answer = 0;
for (rows = 0; rows < array.length; rows++);
{
for(columns = 0; columns < array[0].length; columns++)
{
answer = array[rows][columns];
}
for(columns = 0; columns < array[0].length; columns++)
{
if(array[rows][columns]==0)
{
array[rows][columns]=10-answer ;
}
}
answer = 0;
}
public static void setHints(int [][] array) {
}
public static boolean isInBounds(int i, int j, int[][] board){
return (i >= 0 && i < board.length) && (j >= 0 && j < board[i].length);
}
public static boolean isBomb(int value){
return value == -1;
}
public static void main(String[] args){
int [][] matrix = {
{-1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0},
{0, 0, 0, -1, 0, -1},
{0, 0, 0, -1, 0, 0},
{0, 0, 0, 0, 0, 0}
};
int [][] matrix2 = {
{6, 3, 2, 0, 4},
{34, 53, 0, 23, 1},
{0, 23, 54, 11, 7}
};
int [][] matrix3 = {
{ 0, -1, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ -1, 0, 0, 0, 0, 0 },
{ -1, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
addTo10(matrix2);
setHints(matrix);
setHints(matrix3);
}
}