Skip to content

deveedutta/gameoflife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Game of Life

Cross browser working model for Jon Conway's Game of Life implemented using Javascript and HTML Table

Declaration

I took help from Julian Pulgarin's code to understand how the algorithm works and how the code should behave. Honestly, I couldn't have accomplished this in this short while without his publication. My code is not plagiarized because I've applied my 'custom' stupidity to solve problems hereS.

Download

git clone [email protected]:deveedutta/gameoflife.git
cd gameoflife/

Running

  • Download/Clone the repo/extract the contents
  • Open index.html in browser
  • Click to make the cells alive. Select around 10-20 cells this way.
  • Click on the start button
  • See the action happening.
  • Want to increase/change the grid size ? Enter any number in text-box and hit enter.
  • Hitting enter calls reinit() method with the new grid size
  • Use 'start/stop' to toggle animation

Steps to use

Initialize reference to html variables

var 
	canvas              = document.querySelector('#gameCanvas')
,   startAnimation      = document.querySelector('#startAnimation')
,   animationStarted    = false
,   gridSize            = document.querySelector('#gridsize')

Call init

$$.init ( canvas, { ... } );

Use registerListener to register event listeners

$$.registerListener( HTMLElement , 'eventName', eventHandlerFunction, bubbleTrueORfalse );

Compatility

I created this using table > tr > td. I think it should work in every browser. If you find any issues, please notify me.

About

Cross browser working model for Conway's Game of Life

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published