gibney.org
:
Technology
:
Javascript
:
Experiments
:
Conway's Game of Life
(Entry Nr. 306, by user 1 |
edit
)
<style> a { text-decoration: none; color: #a0a050; } </style> <table id=meta style="text-align: center; color: #808080; width: 100%; height: 100%;"> <tr><td> <canvas id=conway width=501 height=501></canvas><br> <table style="margin: auto;"><tr><td style="width: 5em;"> </td><td> <a href=# onclick="CG.start(); return false;">Start</a> | <a href=# onclick="CG.stop(); return false;">Stop</a> | <a href=# onclick="CG.randomize(); return false;">Random</a> | <a href=# onclick="CG.clear(); return false;">Clear</a> </td><td style="width: 5em; white-space: nowrap; font-size: 70%; text-align: right; color: #808080;" id=Timer> </td></tr></table> </td></tr></table> <script> // this works on an empty page, but not in the current layout: //meta =document.getElementById("meta"); //conway=document.getElementById("conway"); //conway.width =meta.offsetWidth; //conway.height=meta.offsetHeight-50; </script> <script src="http://javascript.gibney.org/conway.js" ></script> <script src="http://javascript.gibney.org/conway_gui.js"></script> <script> CG=new ConwayGUI(); CG.randomize(); </script>
conway
the class that calculates it
conway_gui
the class that visualizes it
Create a new entry at this position