-
Notifications
You must be signed in to change notification settings - Fork 1
/
3D.html
79 lines (76 loc) · 2.2 KB
/
3D.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
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Game of Life</title>
<link rel="stylesheet" href="main.css" />
<script src="https://cdn.jsdelivr.net/npm/p5@1.0.0/lib/p5.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/freshfork/p5.EasyCam@1.0.10/p5.easycam.min.js"></script>
</head>
<body>
<div class="header">
<div class="title">
<h1>LIFE</h1>
</div>
<div class="link">
<a href="./index.html">
<h3>2D version</h3>
</a>
</div>
</div>
<h2>generation #<span id="generation">0</span></h2>
<div id="canvas"></div>
<div class="controls-container">
<div class="controls">
<label for="speed">simulation speed</label>
<input
class="slider"
id="speed"
type="range"
min="1"
max="60"
step="1"
value="60"
/>
<label for="blur">motion blur amount</label>
<input
class="slider"
id="blur"
type="range"
min="5"
max="255"
step="1"
value="5"
/>
<div class="buttons">
<button id="playback">start</button>
<button id="clear">clear</button>
<button id="reseed">re-seed</button>
</div>
<div class="info">
<h3>rules:</h3>
<p>
<span class="bold">1.</span> any live cell with fewer than two live
neighbors dies (underpopulation)
</p>
<p>
<span class="bold">2.</span> any live cell with more than 3 live
neighbors dies (overpopulation)
</p>
<p>
<span class="bold">3.</span> any dead cell with exactly 3 live
neighbors becomes alive (reproduction)
</p>
<p>
<span class="bold">4.</span> in any other case the cell lives on to
the next generation (aging)
</p>
</div>
</div>
</div>
<script src="cell.js"></script>
<script src="grid.js"></script>
<script src="life3D.js"></script>
</body>
</html>