forked from geekhub-js-2014/life-homework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
39 lines (38 loc) · 1.18 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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="main.css">
</head>
<body>
<div class="container">
<h1>Life</h1>
<form>
<pre class="form-control" id="editor">
Life = {
/*
The rules
https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
1. Any live cell with less than two live neighbours dies, as if caused by under-population.
2. Any live cell with two or three live neighbours lives on to the next generation.
3. Any live cell with more than three live neighbours dies, as if by overcrowding.
4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
*/
step: function(map, iteration) {
return game(map);
}
};
</pre>
<button id="run" class="btn">Run</button>
<button id="stop" class="btn">Stop</button>
</form>
<div id="output"></div>
</div>
<script src="bower_components/ace-builds/src/ace.js"></script>
<script src="main.js"></script>
<script src="cups.js"></script>
<script src="life.js"></script>
</body>
</html>