-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
31 lines (31 loc) · 1007 Bytes
/
index.html
File metadata and controls
31 lines (31 loc) · 1007 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Evolution</title>
<style type="text/css">
* { margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; }
canvas { display: block; width: 100%; height: 100%; }
</style>
<!--link rel="stylesheet" href="css/editor.css"-->
<script type="text/javascript" src="js/evolution.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
var canvas = document.getElementById("world");
window.evolution.init(64);
window.evolution.render(canvas);
setInterval(function(){
window.evolution.step()
window.evolution.render(canvas);
}, 10);
setInterval(function(){
console.log(window.evolution.statistic());
}, 10000);
});
</script>
</head>
<body>
<canvas id="world"></canvas>
</body>
</html>