-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·207 lines (188 loc) · 12.8 KB
/
index.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="Justin Kuang is a Cornell University student studying Computer Science, Applied Mathematics, and Economics."
name="description" />
<meta content="Justin Kuang" name="author" />
<meta content="VV6ktlvr7lkd-k4F13kugbHv2HaJF2bMm3_pTbk0xWM" name="google-site-verification" />
<script type="text/javascript">
var host = "justinkuang.com";
if (host == window.location.host && window.location.protocol != "https:")
window.location.protocol = "https";
</script>
<link href="https://justinkuang.com" rel="canonical">
<!-- <link rel="icon" href="images/favicon.ico"> -->
<title>a Battleship AI | Presented by Justin Kuang</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
</head>
<!--ugly hardcoded HTML, I need react.js in my life-->
<body>
<div id="left" class="col-md-6">
<table id="grid">
<tr>
<td id="no-border"></td>
<td><b>0</b></td>
<td><b>1</b></td>
<td><b>2</b></td>
<td><b>3</b></td>
<td><b>4</b></td>
<td><b>5</b></td>
<td><b>6</b></td>
<td><b>7</b></td>
<td><b>8</b></td>
<td><b>9</b></td>
</tr>
<tr>
<td><b>0</b></td>
<td id="00" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="01" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="02" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="03" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="04" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="05" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="06" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="07" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="08" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="09" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
</tr>
<tr>
<td><b>1</b></td>
<td id="10" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="11" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="12" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="13" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="14" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="15" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="16" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="17" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="18" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="19" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
</tr>
<tr>
<td><b>2</b></td>
<td id="20" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="21" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="22" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="23" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="24" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="25" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="26" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="27" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="28" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="29" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
</tr>
<tr>
<td><b>3</b></td>
<td id="30" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="31" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="32" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="33" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="34" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="35" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="36" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="37" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="38" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="39" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
</tr>
<tr>
<td><b>4</b></td>
<td id="40" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="41" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="42" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="43" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="44" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="45" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="46" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="47" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="48" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="49" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
</tr>
<tr>
<td><b>5</b></td>
<td id="50" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="51" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="52" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="53" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="54" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="55" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="56" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="57" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="58" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="59" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
</tr>
<tr>
<td><b>6</b></td>
<td id="60" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="61" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="62" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="63" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="64" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="65" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="66" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="67" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="68" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="69" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
</tr>
<tr>
<td><b>7</b></td>
<td id="70" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="71" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="72" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="73" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="74" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="75" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="76" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="77" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="78" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="79" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
</tr>
<tr>
<td><b>8</b></td>
<td id="80" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="81" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="82" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="83" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="84" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="85" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="86" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="87" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="88" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="89" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
</tr>
<tr>
<td><b>9</b></td>
<td id="90" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="91" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="92" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="93" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="94" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="95" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="96" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="97" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="98" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
<td id="99" contenteditable='true' onclick="dotheneedful(this)" tabindex="-1"></td>
</tr>
</table>
<button onclick="startGame()">Start Game</button>
<button onclick="randomPlacement()">Random Board</button>
<button onclick="reset()">Reset</button>
<div id ="turncounter"></div>
</div>
<div id="right" class="col-md-5 col-sm-8">
<div>
<h1>Instructions:</h1>
<p>You have five ships: a Carrier (C), of length 5, a Battleship (B), of length 4, a Destroyer (D), of length 3,
a Submarine (S), of length 3, and a Gunboat (G), of length 2. Place all five ships within the grid denoted
by typing the uppercase first letter of each ship name. No ships may overlap. Ships <b>are</b> allowed to
be touching.
</p>
</div>
</div>
<script src="js/arrow_nav.js"></script>
<script src="js/AI.js"></script>
</body>
</html>