Conways Game of Life
This is a very nice version of Conway's Game of Life (invented by Cambridge mathematician John Conway) written in Java (source code also available). This game became widely known when it was mentioned in an article published by Scientific American in 1971. It consists of a collection of cells which, based on a few mathematical rules, can live, die, or multiply. Depending on the initial conditions, the cells form various patterns throughout the course of the game.
The Rules are very simple:
Each 'populated' cell with one or no neighbors dies, as if by loneliness.
Each 'populated' cell with four or more neighbors dies, as if by overpopulation.
Each 'populated' cell with two or three neighbors survives.
Each 'empty' cell with three neighbors becomes populated.