-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
68 lines (68 loc) · 2.13 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
<!DOCTYPE html>
<head>
<title>Battleship AI</title>
<script type="text/javascript" src="main.js"></script>
<style>
canvas {
border: 1px solid;
}
.controls {
display: inline-block;
}
.markers {
display: inline-block;
line-height: 50px;
font-size: 30px;
top: -10px;
position: relative;
}
.markers.x {
display: block;
margin-left: 50px;
}
.markers.x span {
display: inline-block;
margin-right: 32px;
}
.controls button {
display: block;
font-size: 1em;
margin-bottom: 0.4em;
}
</style>
</head>
<body>
<h1>Battleship "Solver"</h1>
<p>Based on a <a href="http://www.datagenetics.com/blog/december32011/index.html">superposition-based algorithm described here</a>. For more details, see the <a href="README.md">README</a>.</p>
<h2>Directions:</h2>
<p>When you're opponent is ready, click the fire button. Ask your opponent if the coordinates indicated are a hit or a miss, and click the Ok (hit) or cancel (miss) button.</p>
<p>When your opponent indicates that you have sunk their X ship (which they must do), click the corresponding button. Then click the "Confirm hits" button and click on the positions on the grid where the ship was. Then click "Done".</p>
<p>When you have destroyed all the ships, the game is ended and the move count will be displayed.</p>
<div class="markers x">
<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span>10</span>
</div>
<div class="markers y">
A<br>
B<br>
C<br>
D<br>
E<br>
F<br>
G<br>
H<br>
I<br>
J<br>
</div>
<canvas id="canvas" width="500" height="500"></canvas>
<div class="controls">
<button id="step">Fire</button>
<button id="confirm-hits">Confirm hits</button>
<button id="sunk-aircraftcarrier">Sunk Aircraft Carrier (5)</button>
<button id="sunk-battleship">Sunk Battleship (4)</button>
<button id="sunk-destroyer">Sunk Destroyer (3)</button>
<button id="sunk-submarine">Sunk Submarine (3)</button>
<button id="sunk-patrolboat">Sunk Patrolboat (2)</button>
</div>
<div id="result"></div>
<p class="credit">Created by <a href="http://djmadeira.com">DJ Madeira</a>.</p>
</body>