-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
49 lines (45 loc) · 2.12 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Knight's Tour Visualization</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"/>
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.1/build/pure-min.css">
<link rel="stylesheet" href="index.css"/>
<script src="tour.js"></script>
<script src="index.js"></script>
</head>
<body>
<h1 class="center">Knight's Tour Visualization</h1>
<header class="center">An online <a href="https://en.wikipedia.org/wiki/Knight%27s_tour">Knight's tour</a> visualizer using divide and conquer algorithm.</header>
<p><b>Tip:</b> An <i>n</i> * <i>n</i> chessboard has a <b>closed knight's tour</b> iff <i>n</i> ≥ 6 is even.</p>
<p>
<b>Note:</b> The pieces of <a href="https://en.wikipedia.org/wiki/Chess">chess</a> are placed inside a square,
while the pieces of <a href="https://en.wikipedia.org/wiki/Xiangqi">Chinese chess</a> are placed on the intersections of the lines.
</p>
<form class="pure-form">
<p>
<label for="boardSize">Board size:</label>
<input type="number" id="boardSize" value="14" min="6" step="2" required onkeyup="drawEmptyBoard()" onchange="drawEmptyBoard()"/>
(Board size should be an even number).
</p>
<p>
<label for="strokeTime">Time of a stroke (ms):</label>
<input type="number" id="strokeTime" value="50" min="0" required />
</p>
<p class="center">
<input type="button" class="pure-button" onclick="stopDraw()" value="Stop"/>
<input type="button" class="pure-button pure-button-primary" onclick="startDraw()" value="Start"/>
</p>
</form>
<div class="center">
<canvas id="canvas" width="500" height="500">Canvas not supported</canvas>
</div>
<!-- GitHub ribbon -->
<a href="https://github.com/sgalal/knights-tour-visualization">
<img decoding="async" style="position: absolute; top: 0; right: 0; border: 0;"
alt="Fork me on GitHub" src="forkme_right_red_aa0000.png"/>
</a>
</body>
</html>