Game Of Life (Python-Based CLI)
When I was at Duke, I took a class called Artificial Life, Culture & Evolution and one particular topic has stuck with me after all these years: Conway’s Game of Life.
For those not familiar, Conway’s Game of Life is a framework for simulating cellular automata. In Conway’s “Game”, a n-dimensional grid of cells is “seeded” with values from a pre-defined set of states (for example: 0 and 1). At each subsequent time step, the new state of each cell is calculated based on the states of its eight immediate neighbors. By applying a simple set of rules, wildly different and endlessly entertaining visuals can be generated using varying start states.
What’s the point? you may ask. Well, cellular automata can simulate real-world biological systems or entire universes, if you want to take it that far. On a less grandiose level, we can use cellular automata to create interesting animated gifs.
In revisiting Conway’s Game of Life, my goal was to create a command-line interface that enables users to generate universes to their specifications. In particular, I wanted the flexibility to customize the size, length and frame rate of the animation as well as the content itself, namely the starting seed and the color scheme. Of course, I couldn’t help but add some “mayhem”, enabling users to seed a little bit of chaos with the optional command-line argument --mayhem True
.
For instructions on downloading and using my Conway’s Game of Life Python-based CLI, check out the project on Github.