Fork Me on GitHub


The Game of Life

Download this project as a .zip file Download this project as a tar.gz file

A javascript implementation of the Game of Life,'s_Game_of_Life.

The above was created with the following:
            var canvas = document.getElementById("theCanvas");
            // Re-size the canvas to fit the whole screen. Do not use the JQuery selector here
            // since we are changing the canvas's width and height not its css width and height.
            canvas.width = $(".background").width();
            canvas.height = $(".background").height();
            var context = canvas.getContext("2d");

            if (board == null)
              board = new GameOfLife(context, {color: "blue"});

            var rowStart = 6;
            var colStart = 6;
            board.createGliderGun(rowStart, colStart);

            // Init a glider.
            board.createGlider(rowStart*4, colStart*4);