For the uninitiated, Conway’s Game of Life consists of a grid of cells and a set of rules. A cell is either dead or alive and its state changes based on the state of its neighbouring cells. Quoting Wikipedia:
1. Any live cell with fewer than two live neighbours dies, as if caused by under-population.
2. Any live cell with two or three live neighbours lives on to the next generation.
3. Any live cell with more than three live neighbours dies, as if by overcrowding.
4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
Applying these rules repeatedly to a randomly populated grid can lead to an animated frenzy of patterns. The simplest patterns are just static “still lifes”, like a 2 by 2 block of live cells, that remain in the same state after the rules are applied. Other patterns oscillate between two states forever. Wikipedia goes into much more detail, so I encourage you to read the page for more information.
One of the most interesting patterns, however, is the “glider”. A simple 4 by 4 pattern that actually moves across the grid in a diagonal path. These gliders are actually quite common on a randomly populated grid but they can be hard to spot as they flit in and out of existence on a busy grid.
View the source code in my “Gliders of Life” project on GitHub.
Being able to detect gliders on a grid allows for some interesting applications. For instance, you could count the number of gliders and use that count as a measure of “interesting” activity in a grid. You could also try to determine the optimal conditions for glider generation.