-
Notifications
You must be signed in to change notification settings - Fork 0
/
TicTacToeTest.java
65 lines (49 loc) · 1.84 KB
/
TicTacToeTest.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
class TicTacToeTest
{
public static void main(String[]args)
{
TicTacToeSpace[][] board1 = { {new TicTacToeSpace(1),new TicTacToeSpace(1),new TicTacToeSpace(1)},
{new TicTacToeSpace(2),new TicTacToeSpace(0),new TicTacToeSpace(2)},
{new TicTacToeSpace(0),new TicTacToeSpace(0),new TicTacToeSpace(0)}};
int[][] board2 = { {2,1,0},
{0,2,0},
{1,1,2}};
int[][] board3 = { {2,1,2},
{2,1,1},
{1,2,1}};
int[][] board4 = { {8,0,1},
{0,2,1},
{0,2,1}};
TicTacToeBoard b1 = new TicTacToeBoard();
TicTacToeBoard b2 = new TicTacToeBoard(b1);
System.out.println(b1.setSpace(0,0,1));
System.out.println(b1.setSpace(0,1,1));
System.out.println(b1.setSpace(0,2,1));
System.out.println(b1.setSpace(0,4,1));
System.out.println(b1.setSpace(1,1,4));
System.out.println("\nb1:");
System.out.println(b1);
System.out.println("\nb2:");
System.out.println(b2);
TicTacToeBoard b3 = new TicTacToeBoard(board1);
TicTacToeBoard b4 = new TicTacToeBoard(board2);
System.out.println("\nb3:");
System.out.println(b3);
System.out.println("b3 isWin: " + b3.isWin());
System.out.println("b3 isDraw: " + b3.isDraw());
System.out.println("\nb4:");
System.out.println(b4);
System.out.println("b4 isWin: " + b4.isWin());
System.out.println("b4 isDraw: " + b4.isDraw());
TicTacToeBoard b5 = new TicTacToeBoard(board3);
TicTacToeBoard b6 = new TicTacToeBoard(board4);
System.out.println("\nb5:");
System.out.println(b5);
System.out.println("b5 isWin: " + b5.isWin());
System.out.println("b5 isDraw: " + b5.isDraw());
System.out.println("\nb6:");
System.out.println(b6);
System.out.println("b6 isWin: " + b6.isWin());
System.out.println("b6 isDraw: " + b6.isDraw());
}
}