{"id":184716,"date":"2014-09-25T10:51:24","date_gmt":"2014-09-25T17:51:24","guid":{"rendered":"http:\/\/css-tricks.com\/?p=184716"},"modified":"2016-03-04T16:59:04","modified_gmt":"2016-03-04T23:59:04","slug":"game-life","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/game-life\/","title":{"rendered":"The Game of Life"},"content":{"rendered":"

It’s not really a “game” – but more like a set of rules by mathematician John Horton Conway. Imagine a grid of cells, like a spreadsheet or a <table><\/code>. Each cell is either alive or dead. “Rounds” pass one by one. In each round, there are rules on whether a live cell should continue to live or die, and if a dead cell should continue to be dead or become alive.<\/p>\n

<\/p>\n

The Rules<\/h3>\n

It’s sort of meant to replicate a real life environment. Cells can die either by underpopulation or overpopulation, and only live in perfect situations. The rules are pretty simple:<\/p>\n

    \n
  1. Alive cell – Fewer than 2 alive neighbours – dies (underpopulation).<\/li>\n
  2. Alive cell – 2 or 3 neighbours – continues to live (perfect situation).<\/li>\n
  3. Alive cell – More than 3 alive neighbours – dies (overpopulation).<\/li>\n
  4. Dead cell – Exactly three alive neighbours – becomes alive (reproduction).<\/li>\n<\/ol>\n

    Why are you talking about this?<\/h3>\n

    I feel wicked nostalgic about it. A visual version of The Game of Life was the first programming project I ever did in High School. Or if not the first, the first one where I had an “Ah ha!” moment and realized programming and design could be super fun and interesting.<\/p>\n

    Give the problem to any programmer and they will likely solve it in a slightly different way. <\/p>\n