If you have ever participated in a Coderetreat, you are likely to have implemented Conway’s Game of Life (GoL). It is a reasonably simple simulation of where cells evolve as an example of a Cellular Automaton. It is a well-suited exercise for Coderetreat since the rules are relatively simple, yet it presents the need for a good number of design choices. If you are unfamiliar with it, read the link above or check out The Game of Life: a beginner’s guide.
Like a person shopping for a car who suddenly notices all the models they are interested in while driving around town, I see implementations of Conway’s Game of Life everywhere. They are interesting to look at now and then, especially when I am not preparing for or in the middle of a Coderetreat.
Some recent finds:
- cljs4excel GoL - An example project demonstrating running ClojureScript in Microsoft Exel (via the cljs4excel project)
- https://github.com/Syntaf/GameOfLife - A terminal based GoL implemented in Rust (very colorful)
- bostonaholic/conway-cljs - A ClojureScript implementation of GoL. See it here
- teropa/life.cljs - Another ClojureScript implementation (also using Reagent in a Gist
- Conway’s Game of Life - A Demonstration and Postmortem of a Clojure/ClojureScript Project - A write-up with code samples on implementing GoL in Clojure
- sasa1977/conway.ex - An implementation of GoL in Elixir
- eoinsha/gol_ex - Another Elixir implementation of GoL (one of the few I could get running (I’m new to Elixir))
You can see where some of my recent language interests lie by what I present here. I find it helpful to read the code in implementations of a problem I am already familiar with to practice code reading and learn about different implementation approaches.
Please let me know if you have seen a Game of Life implementation that you find interesting or insightful. Also, what code do you read for learning?