-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
61 lines (61 loc) · 3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="//bootswatch.com/4/slate/bootstrap.css" media="screen">
<title>Polyomino puzzle solver</title>
</head>
<body>
<div class="container">
<div class="row my-2">
<div class="col-12">
<h1 class="text-center">Polyomino puzzle solver</h1>
</div>
</div>
<div class="row my-2">
<div class="col-12">
<h4>Buttons</h4>
<ul>
<li>"Try example solution" button runs example solution with predefined pieces and board sized 8x8.</li>
<li>"Solve" button tries to find a solution. If there are multiple solutions, each click on this button will draw the next solution.</li>
</ul>
</div>
<div class="col-12 mt-4">
<h4>Instructions</h4>
<ol>
<li>Open up your browser console.</li>
<li>
<div>Add pieces by calling <code>Solver.addPiece();</code> where first parameter is array of coordinates objects and second is optional color. Examples:</div>
<div><code>Solver.addPiece([{ x: 0, y: 0 }, { x: 0, y: 1 }], 'green');</code></div>
<div><code>Solver.addPiece([{ x: 0, y: 0 }, { x: 0, y: 1 }, { x: 0, y: 2 }], 'grey');</code></div>
</li>
<li>
<div>Create solver board by calling <code>Solver.createSolver();</code> with an array where first element is the board width and second is board height, like so:</div>
<div><code>Solver.createSolver([1, 5]);</code></div>
</li>
<li>
<div>Now to find the solution, either click the "Solve" button or run the 'solve' command manually:</div>
<div><code>Solver.solve();</code></div>
</li>
</ol>
<p>For more information about usage and other details, please see the <a href="https://github.com/dmarchuk/polyomino-puzzle-solver/" class="link">GitHub repository</a>.</p>
</div>
</div>
<div class="row my-2">
<div class="col-12 text-center">
<button class="btn btn-info" id="example-solution-button">Try example solution</button>
<button class="btn btn-success" id="solve-button" disabled>Solve</button>
</div>
</div>
<div class="row my-2">
<div class="col-12 text-center">
<canvas id="canvas" style="border:1px solid #d3d3d3;"></canvas>
<div id="error" class="text-danger error display-none"></div>
</div>
</div>
</div>
<script src="app.js" type="text/javascript"></script>
</body>
</html>