-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
69 lines (63 loc) · 2.55 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
67
68
69
<!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" type="text/css" href="styles.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
<script src="sketch.js"></script>
</head>
<body>
<H1> Game of Life (Clone) </H1>
<div class = "grid__container">
<div class = "grid_item">
<H2>About</H2>
<p>
Game of Life is a cellular automaton devised by John Conway. A player gives
an initial state, which then evolves according to a set of rules:
</p>
<ol>
<li>
A "live cell" (white) with fewer than two live neighbours "dies" (turns black),
simulating underpopulation.
</li>
<li>
A live cell with more than three live neighbours dies, simulating overpopulation.
</li>
<li>
A dead cell with exactly three live neighbours revives live cell, simulating reproduction.
</li>
<li>
A live cell with exactly two or three live neighbours lives on.
</li>
</ol>
<H2>Instructions</H2>
<ul>
<li>Click "Play/Pause" to begin and pause the animation</li>
<li>Click "Step" to go to next stage of the grid</li>
<li>Click "Clear" to remove all colored blocks from grid</li>
<li>
Click "Reset" to reset current board and return to randomly
generated board.
</li>
<li>Drag or click on the grid to draw with your mouse.</li>
<li>Use the slider to zoom in and out on the canvas.</li>
<li>
Use the arrow keys (← → ↑ ↓) to pan around the canvas
when zoomed in.
</li>
</ul>
<div class = "button_container">
<button onclick="run()" id="loop">Play/Pause</button>
<button onclick="step()" id="play">Step</button>
<button onclick="clearGrid()" id="clear">Clear</button>
<button onclick="setup()" id="reset">Reset</button>
</div>
</div>
<div class = "grid_item">
<div class = "canvas"></div>
</div>
</div>
</body>
</html>