Controls:

Click on canvas to draw, right click to erase

Cell Size:

So what is the game of life?

Conway's Game of life is a classic mathematical/computer science problem/game.
The board is populated with cells and these cells have rules.
  1. Any live cell with fewer than two live neighbors dies, as if by under population.
  2. Any live cell with two or three live neighbors lives on to the next generation.
  3. Any live cell with more than three live neighbors dies, as if by overpopulation.
  4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
This game is an example of the Halting problem, and is in its self turing complete

What were the challenges of implementing this?

Just the basic rules is enough to get started but fleshing out the implementation details from scratch are another beast. I needed to make the concept of a cell, be able to tell how many neighbors it has, and draw it to the canvas.
I toyed with the idea of making a cell class and an assortment of cells that each have their own methods to check neighbors and draw to the screen, however that felt overkill for how simple this was. Instead i simply made an array of cells(booleans) that are either alive(true) or dead(false).
The most difficult part in drawing them to the screen was how slow it seemed to be. However after some debugging i remembered that i was changing the canvas fill color every time i went to draw a cell. That paired with the fact that i don't actually need to draw the dead cells, just the alive ones, led to a dramatic increase in performance and it became fast enough that i could toy with animating it.