-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
69 lines (58 loc) · 1.68 KB
/
Test.java
File metadata and controls
69 lines (58 loc) · 1.68 KB
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
66
67
68
69
import java.util.*;
public class Test {
public static void main(String[] args) {
Player p = new Player('B', 4, 0, 0);
Scanner in = new Scanner(System.in);
p.printBoard();
ArrayList<Move> cs = p.getLegal(p.board, 'B');
//Move m = new Move(p.board, 3, 2, 'B', true);
//System.out.println("here " + m + " " + m.score);
for (Move c : cs) {
System.out.println(c.x + " " + c.y + " " + c.score);
}
String m = p.makeMove();
p.printBoard();
cs = p.getLegal(p.board, 'W');
//Move m = new Move(p.board, 3, 2, 'B', true);
//System.out.println("here " + m + " " + m.score);
for (Move c : cs) {
System.out.println(c.x + " " + c.y + " " + c.score);
}
m = p.makeMove();
//System.out.println(m);
/*char[][] board =
{
{'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B'},
{'W', 'W', 'W', 'W', 'W', 'W', 'B', 'B'},
{'W', 'W', 'W', 'W', 'W', 'B', 'W', 'B'},
{'W', 'W', 'W', 'W', 'B', 'W', 'W', 'B'},
{'W', 'W', 'W', 'W', 'B', 'W', 'B', 'B'},
{'W', 'W', 'W', 'B', 'W', 'B', 'B', 'B'},
{'W', 'W', 'W', 'W', 'B', 'W', ' ', 'B'},
{'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B'}
};
p.board = board;
p.printBoard();
ArrayList<Move> cs = p.getLegal(p.board, 'W');
for (Move c : cs) {
System.out.println(c.x + " " + c.y);
}
String m = p.makeMove();
System.out.println(m);
//p.update(true, cs.get(0).x, cs.get(0).y);
*/
/*char player = 'B';
while (true) {
p.printBoard();
String line = in.nextLine();
int x;
int y;
if (!line.equals("pass")) {
x = Integer.parseInt(line.split(" ")[0]);
y = Integer.parseInt(line.split(" ")[1]);
p.update(player == 'B', x, y);
}
player = (player == 'W') ? 'B' : 'W';
}*/
}
}