/
index.htm
37 lines (32 loc) · 1.15 KB
/
index.htm
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Conway's game of life</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" language="javascript" src="scripts/lib/jquery-1.7.1.min.js"></script>
<script type="text/javascript" language="javascript" src="scripts/conway/conway.js"></script>
</head>
<body>
<canvas class="center" id="canvas" height="801px" width="801px"></canvas>
<div>
<input id="tick" type="button" value="Tick"/>
<input id="start" type="button" value="Start"/>
<input id="pause" type="button" value="Pause"/>
</div>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
var game = conway.game(conway.GOSPER_GLIDER_GUN);
game.initialize($("#canvas")[0]);
$("#tick").click(function(){
game.next();
});
$("#start").click(function(){
game.start();
});
$("#pause").click(function(){
game.pause();
});
});
</script>
</body>
</html>