-
Notifications
You must be signed in to change notification settings - Fork 0
/
TicAI.java
48 lines (45 loc) · 1.32 KB
/
TicAI.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
class TicAI
{
public static void main (String [] args)
{
Board board = new Board();
Player human = new Player();
AI pc = new AI();
board = human.move(board);
board.print();
board = pc.firstMove(board);
board.print();
Boolean cont = true;
while (cont)
{
board = human.move(board);
board.print();
switch (board.checkForWin())
{
case -1:
System.out.println("AI LOST. FUCK.");
return;
case 0:
System.out.println("DRAW. COOL.");
return;
case 2:
System.out.println("AI WINS. SICKO");
return;
}
board = pc.move(board);
board.print();
switch (board.checkForWin())
{
case -1:
System.out.println("AI LOST. FUCK.");
return;
case 0:
System.out.println("DRAW. COOL.");
return;
case 2:
System.out.println("AI WINS. SICKO");
return;
}
}
}
}