-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchomp.html
140 lines (138 loc) · 13.3 KB
/
chomp.html
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<div class="col-lg-12">
<div class="tile">
<div class="row animated fadeIn" ng-hide="!chompOver">
<div class="col-lg-12">
<div class="animated fadeIn" ng-hide="!chompOver">
<h3 class="tile-title text-black">
Well done {{chompTurn}}!<br><br>
You won the game!<br>
</h3>
</div>
</div>
</div>
<div class="animated fadeIn" ng-hide="chompOver">
<h4 class="text-black">{{chompTurn}}'s Turn</h4>
<br>
<div class="row">
<div class="col-lg-12">
<div ng-hide="chompAIChecked">
<table class="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a href="" ng-click="changeChompTurn();
chompPos(0, 0);" ng-hide="!matrix[0][0]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(0, 1);" ng-hide="!matrix[0][1]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(0, 2);" ng-hide="!matrix[0][2]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(0, 3);" ng-hide="!matrix[0][3]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(0, 4);" ng-hide="!matrix[0][4]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(0, 5);" ng-hide="!matrix[0][5]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(0, 6);" ng-hide="!matrix[0][6]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
</tr>
<tr>
<td><a href="" ng-click="changeChompTurn();
chompPos(1, 0);
" ng-hide="!matrix[1][0]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(1, 1);" ng-hide="!matrix[1][1]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(1, 2);" ng-hide="!matrix[1][2]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(1, 3);" ng-hide="!matrix[1][3]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(1, 4);" ng-hide="!matrix[1][4]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(1, 5);" ng-hide="!matrix[1][5]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(1, 6);" ng-hide="!matrix[1][6]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
</tr>
<tr>
<td><a href="" ng-click="changeChompTurn();
chompPos(2, 0); increaseChompFlag();" ng-hide="!matrix[2][0]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(2, 1);" ng-hide="!matrix[2][1]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(2, 2);" ng-hide="!matrix[2][2]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(2, 3);" ng-hide="!matrix[2][3]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(2, 4);" ng-hide="!matrix[2][4]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(2, 5);" ng-hide="!matrix[2][5]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(2, 6);" ng-hide="!matrix[2][6]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
</tr>
<tr>
<td><a href="" ng-click="chompDone();" ng-hide="chompOver"><img src="img/chomp-x.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(3, 1);
increaseChompFlag();" ng-hide="!matrix[3][1]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(3, 2);" ng-hide="!matrix[3][2]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(3, 3);" ng-hide="!matrix[3][3]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(3, 4);" ng-hide="!matrix[3][4]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(3, 5);" ng-hide="!matrix[3][5]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="changeChompTurn();
chompPos(3, 6);" ng-hide="!matrix[3][6]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
</tr>
</table>
</div>
<div ng-hide="!chompAIChecked">
<table class="center" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><a href="" ng-click="chompAI(4,1);" ng-hide="!box[4][1]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(4,2);" ng-hide="!box[4][2]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(4,3);" ng-hide="!box[4][3]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(4,4);" ng-hide="!box[4][4]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(4,5);" ng-hide="!box[4][5]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(4,6);" ng-hide="!box[4][6]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(4,7);" ng-hide="!box[4][7]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
</tr>
<tr>
<td><a href="" ng-click="chompAI(3,1);" ng-hide="!box[3][1]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(3,2);" ng-hide="!box[3][2]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(3,3);" ng-hide="!box[3][3]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(3,4);" ng-hide="!box[3][4]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(3,5);" ng-hide="!box[3][5]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(3,6);" ng-hide="!box[3][6]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(3,7);" ng-hide="!box[3][7]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
</tr>
<tr>
<td><a href="" ng-click="chompAI(2,1);" ng-hide="!box[2][1]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(2,2);" ng-hide="!box[2][2]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(2,3);" ng-hide="!box[2][3]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(2,4);" ng-hide="!box[2][4]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(2,5);" ng-hide="!box[2][5]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(2,6);" ng-hide="!box[2][6]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(2,7);" ng-hide="!box[2][7]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
</tr>
<tr>
<td><a href="" ng-click="chompDone();" ng-hide="!box[1][1]"><img src="img/chomp-x.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(1,2);" ng-hide="!box[1][2]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(1,3);" ng-hide="!box[1][3]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(1,4);" ng-hide="!box[1][4]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(1,5);" ng-hide="!box[1][5]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(1,6);" ng-hide="!box[1][6]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
<td><a href="" ng-click="chompAI(1,7);" ng-hide="!box[1][7]"><img src="img/chomp.png" alt="chocolate" class="img-responsive center-block"></a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br>
</div>
<div class="animated fadeIn">
<br>
<button type="button" ng-hide="!chompOver" class="btn btn-inverse" ng-click="restartChomp();">Restart</button>
</div>
</div>
</div>