-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
46 lines (44 loc) · 2.1 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
<html>
<head>
<title>A* Pathfinding - Jack Walmsley</title>
<link href="material.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="top-bar">
<h1 style="text-align:center;">A* Pathfinding</h1>
</div>
<div class="instructions-wrapper">
<ul class="instructions">
<li>Click and drag to draw walls</li>
<!-- <li>Euclidean heuristic:<br>pythagorean theorem distance</li>-->
<!-- <li>Manhattan heuristic:<br>deltaX + deltaY</li>-->
</ul>
</div>
<canvas id="canvas" tabindex="1" autofocus width="600" height="600"
style="margin:30px; border: none; padding: none;"></canvas>
<script src="drawableObjects.js"></script>
<script src="main.js"></script>
<script src="aStar.js"></script>
<!--<div id="speed-counter">Speed: </div>-->
<!--<button type="button" onclick="changeAlgorithmSpeed(1)"> Speed Up</button>-->
<!--<button type="button" onclick="changeAlgorithmSpeed(-1)"> Slow Down</button>-->
<div class="controls">
<button type="button" class="unselected" onclick="algorithmUpdateInterval = setInterval(updateAStar, 10)">
Start A* Algorithm
</button>
<button type="button" class="unselected" onclick="clearInterval(algorithmUpdateInterval)">Stop Algorithm</button>
<button type="button" class="unselected" onclick="updateAStar()"> One Step</button>
<button type="button" class="unselected" onclick="showCosts=!showCosts; update()">Show/Hide Costs</button>
<button type="button" onclick="heuristic = 0; selectButtons()" id="euclidean"><img src="icons/euclidean.png"
style="vertical-align:middle">
Euclidean Heuristic
</button>
<button type="button" onclick="heuristic = 1; selectButtons()" id="manhattan"><img src="icons/manhattan.png"
style="vertical-align:middle">
Manhattan Heuristic
</button>
<button type="button" class="unselected" onclick="reset()">Reset</button>
<script>selectButtons();</script>
</div>
</body>
</html>