The Game of Life

Yesterday I built Conway's Game of Life in Elm. I had a blast. Conway's Game of Life is my favorite programming exercise. It can be extended to accept user input. You can put constraints on its construction. And It usually exercises most of the right parts of a programming language.

Conway's Game of Life is pretty simple regarding how it works. You have a grid of "cells," and each cell can be either "alive" or "dead." The game works by "stepping" through generations. Four simple rules determine the state of the grid for the next generation: 

1. Any live cell with fewer than two live neighbors dies as if caused by underpopulation.
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.

The result is so much fun to look at. I was hoping to embed the results here... but, alas.