-
Notifications
You must be signed in to change notification settings - Fork 0
/
cellular-automata.html
40 lines (33 loc) · 1016 Bytes
/
cellular-automata.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
<html>
<head>
<title>Conway's Game of Life Demo</title>
<style type="text/css">
#grid {
border-spacing: 0px;
padding: 30px;
}
#grid td {
height: 12px;
width: 12px;
border: solid 1px #e0e0e0;
padding: 0px 0px 0px 0px;
display: inline-block;
}
#grid td.filled {
background-color: #006600;
}
</style>
<script type="text/javascript" src="cellular-automata.js"></script>
</head>
<body>
<div>
<label for="period">Period time (in ms): </label>
<input id="period" type="number" placeholder="250">
<label for="pattern">Pattern: </label>
<select id="pattern"></select>
<button onclick="cells.start(document.getElementById('pattern').value, document.getElementById('period').value || 250)">Start</button>
<button onclick="cells.stop()">Stop</button>
</div>
<table id="grid"></table>
</body>
</html>