Here's a simple implementation of Conway's Game of Life using JavaScript and HTML canvas:
2143 chars99 lines
This implementation creates a grid of cells with random initial states, and updates the grid on a loop according to the rules of the Game of Life. The HTML canvas is used to display the grid. The drawGrid
function draws the cells on the canvas, and the updateGrid
function determines the state of each cell based on the number of neighbors it has. The loop is controlled by the gameLoop
function, which repeats the process every 100 milliseconds.
gistlibby LogSnag