Experimenting With The Game Of Life

As I am want to do, I spent an evening a while back putting together a Python version of John Conway's Game of Life: a "zero-player game" in which the board state progresses automatically according to a set of rules.

You can find the code for the game here. It requires just the Python standard library to run, so its easy to get started assuming you have Python >=3.10 installed. (It might run on lower than that but I didn't test it.)

A screenshot of the Game of Life

A screenshot of my version of The Game of Life

Gameplay Video
Thrilling, right?

The initial board state for the game is randomized so each run-through is unique. Some end immediately, so you may have to run the script several times to see something cool happen.

Because it's written in Python, the game is single threaded and quite lacking in raw performance, but because it's written in Python the game was also incredibly easy to put together—taking about three hours in total including debugging, though I did spend three more hours optimizing the render performance for no reason.

As with most of my recent script projects, I don't really have a point or reason for doing it other than to have some fun building toy projects. Like I've said before:

Scripts are programming candy whereas app development is the real meat and potatoes. In a script you can take shortcuts, be a bit messy, and forgo worrying about the complexities of large software.
- Take A Break, Script Something

In that same time I've also thrown together a few little scripts to visualize the chaos of the Collatz Conjecture and simulate the dynamics of 2-D gas expansion. Are these important? Nope, not at all. Were they fun? Yes, yes they were.


Filed under: programming, fun
Other Links: RSS Feed, JSON Feed, Status Page →