Inspiration

John Horton Conway, one of the world’s greatest mathematicians, passed away this year due to the coronavirus. One of his many contributions was the famous Game of Life, which I implement using C for this project.

What it does

Game of life is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves. The program is usable in the following way:

$ ./gameOfLife [file] [rule]

…where [file] is a PPM ASCII file, and [rule] is a hexadecimal encoding of the generalized Game of Life rules.

Some rules include:

0x1808 - Life - Highly complex behavior.

0x154AA - Replicator - Edward Fredkin's replicating automaton: every pattern is eventually replaced by multiple copies of itself.

0x4 - Seeds - All patterns are phoenixes, meaning that every live cell immediately dies, and many patterns lead to explosive chaotic growth. However, some engineered patterns with complex behavior are known.

0x3FE08 - Life without Death - Also known as Inkspot or Flakes. Cells that become alive never die. It combines chaotic growth with more structured ladder-like patterns that can be used to simulate arbitrary Boolean circuits.

Challenges I ran into and What I learned

The biggest challenge I ran into was getting comfortable with C's memory management and pointers. This were fairly new concept and thus it was challenging. But after spending hours on this project, I have to come to love the beauty and power of C.

Built With

Share this project:

Updates