-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
39 lines (39 loc) · 2.6 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
<!DOCTYPE html>
<html>
<head>
<title>2D Misère Nim</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="nim2d.css" type="text/css" />
</head>
<body>
<div id="p"><h2>2D Misère <a href="https://en.wikipedia.org/wiki/Nim">Nim</a></h2><canvas id="c" width="650" height="650"></canvas></div>
<div id="o">
<h3>Options</h3>
<form autocomplete="on" onsubmit="return false;">
<p>Use AI: <input type="checkbox" id="p1ai" /><label for="p1ai">Player 1</label> <input type="checkbox" id="p2ai" /><label for="p2ai">Player 2</label> <button id="once"><u>O</u>nce</button></p>
<p>AI level: Weak <input type="range" id="lvl" min="0" max="2" step="1" value="1" /> Strong</p>
<p><input type="checkbox" id="analyze" checked="true" /><label for="analyze">Show analysis</label> <input type="checkbox" id="auto" /><label for="auto">Auto move</label></p>
<p><input type="checkbox" id="learning" /><label for="learning">Enable learning (experimental)</label></p>
<p><input type="button" id="undoBtn" value="Undo (Z)" /> <input type="button" id="redoBtn" value="Redo (Y)" />
<button id="stopBtn"><u>S</u>top</button> <button id="resetBtn"><u>R</u>eset</button></p>
<p>Current position: <input type="number" min="9" max="4398046511103" step="1" readonly="true" id="current" value="4398046511094" autocomplete="off" /></p>
<p>Load position: <input type="number" min="9" max="4398046511103" step="1" id="load" placeholder="Click to load" autocomplete="off" /></p>
<p id="info">AI analysis: (x0, y0), (x1, y1), rating (method)</p>
</form>
</div>
<div id="h">
<h3>Help</h3>
1. Players 1 and 2 each draws a rectangle of squares (at least 1) to remove each turn.<br />
2. The player who has to remove the last square loses.<br />
3. To cancel the current move, move the mouse button outside the board.<br />
4. Hints: (if you play perfectly)<br />
- If you leave your opponent with a 2x2 square, you're winning.<br />
- If your opponent leaves you with a 3x3 square, take the center or one of the corners.<br />
- If your opponent leaves you with a 3x4 rectangle, take the middle 2 from the long edge on either side.<br />
- If your opponent leaves you with a 4x4 square, take the 4 center pieces.<br />
- Take your time to think! This is a simple game but it is not easy!<hr />
<p id="f"><a href="https://github.com/CharCoding/2D-Misere-Nim/">2D Misère Nim</a> by <a href="https://github.com/CharCoding/">CharCoding</a>, © 2018.</p>
</div>
<script src="src/nim2d.min.js"></script>
</body>
</html>