89 lines
3.1 KiB
HTML
89 lines
3.1 KiB
HTML
|
<!doctype html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="viewport" content="width=device-width,maximum-scale=1">
|
||
|
<title>Battleboat.js - A JavaScript AI that beats humans at battleship.</title>
|
||
|
<meta name="google" content="notranslate">
|
||
|
<link rel="icon" type="image/png" href="img/favicon.png" />
|
||
|
<link href="styles.css" rel="stylesheet" media="all" />
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<div class="container">
|
||
|
<h1>Battleboat.js</h1>
|
||
|
<p class="tagline">A JavaScript AI that beats humans at battleship.</p>
|
||
|
<p>How to play</p>
|
||
|
<ol class="instructions">
|
||
|
<li id="step1">Select your ships from the left-hand side</li>
|
||
|
<li id="step2">Place your ships on your map</li>
|
||
|
<li id="step3">Click on the cells of the enemy's map<br>
|
||
|
to find and destroy all five enemy ships</li>
|
||
|
<li id="step4">The computer will fire on your ships<br>
|
||
|
immediately after you fire on its ships.</li>
|
||
|
</ol>
|
||
|
<div class="game-container">
|
||
|
<div id="restart-sidebar" class="hidden">
|
||
|
<h2>Try Again</h2>
|
||
|
<button id="restart-game">Restart Game</button>
|
||
|
</div>
|
||
|
<div id="roster-sidebar">
|
||
|
<h2>Place Your Ships</h2>
|
||
|
<ul class="fleet-roster">
|
||
|
<li id="patrolboat">Patrol Boat</li>
|
||
|
<li id="submarine">Submarine</li>
|
||
|
<li id="destroyer">Destroyer</li>
|
||
|
<li id="battleship">Battleship</li>
|
||
|
<li id="carrier">Aircraft Carrier</li>
|
||
|
</ul>
|
||
|
<button id="rotate-button" data-direction="0">Rotate Ship</button>
|
||
|
<button id="start-game" class="hidden">Start Game</button>
|
||
|
<button id="place-randomly" class="hidden">Place Randomly and Start</button>
|
||
|
</div>
|
||
|
<div id="stats-sidebar">
|
||
|
<h2>Stats</h2>
|
||
|
<p><strong>Games Won</strong></p>
|
||
|
<p id="stats-wins">0 of 0</p>
|
||
|
<p><strong>Accuracy</strong></p>
|
||
|
<p id="stats-accuracy">0%</p>
|
||
|
<button id="reset-stats">Reset Stats</button>
|
||
|
<button id="prob-heatmap" class="hidden">Show Probability Heatmap</button>
|
||
|
</div>
|
||
|
<div class="grid-container">
|
||
|
<h2>Your Fleet</h2>
|
||
|
<div class="grid human-player"><span class="no-js">Please enable JavaScript to play this game</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="grid-container">
|
||
|
<h2>Enemy Fleet</h2>
|
||
|
<div class="grid computer-player"><span class="no-js">Please enable JavaScript to play this game</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<script>
|
||
|
// Don't change this variable.
|
||
|
var DEBUG_MODE = localStorage.getItem('DEBUG_MODE') === 'true';
|
||
|
// To turn DEBUG_MODE on, run `setDebug(true);` in the console.
|
||
|
if (!DEBUG_MODE) {
|
||
|
(function (i, s, o, g, r, a, m) {
|
||
|
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
|
||
|
(i[r].q = i[r].q || []).push(arguments)
|
||
|
}, i[r].l = 1 * new Date(); a = s.createElement(o),
|
||
|
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
|
||
|
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
|
||
|
ga('create', 'UA-10730961-10', 'auto');
|
||
|
ga('send', 'pageview');
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<script src="battleboat.js"></script>
|
||
|
<span class="prefetch" id="prefetch1"></span>
|
||
|
<span class="prefetch" id="prefetch2"></span>
|
||
|
<span class="prefetch" id="prefetch3"></span>
|
||
|
</body>
|
||
|
|
||
|
</html>
|