-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
66 lines (66 loc) · 3.11 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
62
63
64
65
66
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Conway’s Game of Life</title>
<link rel="stylesheet" type="text/css" href="assets/styles.css">
<script defer type="module" src="assets/behaviors.js"></script>
</head>
<body>
<header>
<h1>Conway’s Game of Life</h1>
</header>
<main>
<p>
This is my implmentation of <a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Conway’s game of life</a>.
</p>
<details>
<summary>
The rules of the game…
</summary>
<ol>
<li>Any live cell with fewer than two live neighbours dies, as if by underpopulation.</li>
<li>Any live cell with two or three live neighbours lives on to the next generation.</li>
<li>Any live cell with more than three live neighbours dies, as if by overpopulation.</li>
<li>Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.</li>
</ol>
</details>
<p>
<select class="active-before-game" name="grid-size">
<option value="16">16x16</option>
<option value="32" selected>32x32</option>
<option value="64">64x64</option>
<option value="128">128x128</option>
</select>
<select class="active-before-game" name="starting-density">
<option value="25">25%</option>
<option value="33">33%</option>
<option value="50" selected>50%</option>
<option value="67">67%</option>
<option value="75">75%</option>
</select>
<select class="active-before-game" name="refresh-interval">
<option value="16">16ms (60fps)</option>
<option value="32">32ms (30fps)</option>
<option value="64" selected>64ms (15fps)</option>
<option value="100">100ms (10fps)</option>
<option value="250">250ms (4fps)</option>
<option value="500">500ms (2fps)</option>
<option value="1000">1000ms (1fps)</option>
</select>
<button class="active-before-game" id="start">Start Game</button>
<button class="active-during-game" id="stop" disabled>Stop Game</button><br>
Generations: <span id="generations">0</span><br>
Elapsed time: <span id="elapsed">0ms</span>
</p>
<div id="board"></div>
</main>
<footer>
<p>
By <a href="https://andrew.hedges.name">Andrew Hedges</a>, April 2021<br>
MIT licensed source available at <a href="https://github.com/segdeha/life">github.com/segdeha/life</a>.
</p>
</footer>
</body>
</html>