|
@@ -5,15 +5,27 @@ package rocks.zipcode.io.quiz3.arrays;
|
5
|
5
|
*/
|
6
|
6
|
public class TicTacToe {
|
7
|
7
|
|
|
8
|
+ String[][] board;
|
|
9
|
+ String[] row;
|
|
10
|
+ String[] column;
|
|
11
|
+
|
8
|
12
|
public TicTacToe(String[][] board) {
|
|
13
|
+ this.board = board;
|
9
|
14
|
}
|
10
|
15
|
|
11
|
16
|
public String[] getRow(Integer value) {
|
12
|
|
- return null;
|
|
17
|
+
|
|
18
|
+ row = board[value];
|
|
19
|
+
|
|
20
|
+ return row;
|
13
|
21
|
}
|
14
|
22
|
|
15
|
23
|
public String[] getColumn(Integer value) {
|
16
|
|
- return null;
|
|
24
|
+
|
|
25
|
+ for(int i = 0; i< row.length;i++) {
|
|
26
|
+ column[i] = board[0][value];
|
|
27
|
+ }
|
|
28
|
+ return column;
|
17
|
29
|
}
|
18
|
30
|
|
19
|
31
|
public Boolean isRowHomogenous(Integer rowIndex) {
|