-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
74 lines (72 loc) · 1.98 KB
/
Main.java
File metadata and controls
74 lines (72 loc) · 1.98 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
70
71
72
73
74
import java.util.*;
public class Main{
public static void main(String[] args){
GameBoard gb = new GameBoard();
GameEngine ge = new GameEngine();
AdvancedAIPlayer me = new AdvancedAIPlayer(1);
AdvancedAIPlayer them = new AdvancedAIPlayer(2);
initGrid(gb);
ge.start();
/*List<int[]> test = new ArrayList<int[]>();
int[] a = {5,0};
int[] b = {-1,1};
int[] c = {0,2};
int[] d = {-1,3};
int[] e = {-2,4};
test.add(a);
test.add(b);
test.add(c);
test.add(d);
test.add(e);
int be = me.getScoreClosestToZero(test);
System.out.println(be);
System.out.println("Should be 2");*/
//gb.printBoard();
//int c = me.getScoreOfColumn(4,gb,0,them,1);
//int c = me.playChip(gb);
//System.out.println(c);
//gb.placeChipInColumn(me.getPlayerNum(),c);
//gb.printBoard();
//ge.playGame(gb);
//next class init a grid that is 3 or 4 slots from winning to perfect that. THEN move on to starting from the beggining
}
public static void initGrid(GameBoard gb){
gb.changeSlot(5,0,1);
gb.changeSlot(4,0,1);
gb.changeSlot(5,2,1);
gb.changeSlot(5,3,1);
gb.changeSlot(4,3,1);
for(int r = 0; r < 6; r++){
if(r%2==0){
gb.changeSlot(r,0,1);
gb.changeSlot(r,1,1);
gb.changeSlot(r,2,2);
gb.changeSlot(r,3,2);
gb.changeSlot(r,4,1);
gb.changeSlot(r,5,1);
gb.changeSlot(r,6,2);
} else{
gb.changeSlot(r,0,2);
gb.changeSlot(r,1,2);
gb.changeSlot(r,2,1);
gb.changeSlot(r,3,1);
gb.changeSlot(r,4,2);
gb.changeSlot(r,5,2);
gb.changeSlot(r,6,1);
}
}
gb.changeSlot(0,4,0);
gb.changeSlot(1,4,0);
gb.changeSlot(2,4,0);
gb.changeSlot(1,5,1);
gb.changeSlot(2,4,2);
gb.changeSlot(1,3,1);
gb.changeSlot(1,6,1);
gb.changeSlot(0,3,0);
gb.changeSlot(2,4,0);
gb.changeSlot(0,2,0);
gb.changeSlot(0,1,0);
gb.changeSlot(1,3,0);
gb.changeSlot(1,2,0);
}
}