Game of Life Universe

I’m just a general fan of Conway’s Game of Life, mostly for nostalgic reasons. It was one of the first things I ever coded (Turbo Pascal) that was super interesting to me. Probably partially because of the visual and interactive components. I remember working on it feverishly in high school, adding features to a custom-built rudimentary interface. I received praise for it and the code for it was published in some kind of student section of a magazine.

It’s not really a “game”, it’s more a simulation that takes place on a grid of cells, all of which are either dead or alive, and which time elapses in the form “generations”:

  1. Any live cell with two or three live neighbours survives.
  2. Any dead cell with three live neighbours becomes a live cell.
  3. All other live cells die in the next generation. Similarly, all other dead cells stay dead.

That amounts to a fairly fun coding exercise. Like a slightly more involved FizzBuzz, let’s say.

It’s been coded surely millions of times by programmers through the decades. Thousands of times on CodePen alone. I keep a Collection with some interesting examples, including variations.

Just the basics alone are interesting to me. You turn on some random cells, watch them scatter about, and typically degrade into mostly emptiness and a few stable patterns. But it gets more interesting when you learn about the fact that there are some exotic states that a gameboard can get into that can do things like produce infinite movement and infinite new life. A “Glider Gun” is one:

Even that kinda blows my mind. But of course, as nerdy things like this tend to do, things escalate. For example, you can angle the glider guns shots and if you have two streams of them hit each other, they can kinda knock each other out. Put a bunch of guns like that in a row, it’s almost like you’re creating shading in a certain area. Combinations of guns that you time and have effect each other get really weird:

“It is possible for gliders to interact with other objects in interesting ways. For example, if two gliders are shot at a block in just the right way, the block will move closer to the source of the gliders. If three gliders are shot in just the right way, the block will move farther away. This “sliding block memory” can be used to simulate a counter. It is possible to construct logic gates such as AND, OR and NOT using gliders. It is possible to build a pattern that acts like a finite state machine connected to two counters.”

Logic gates?! Indeed.

Things get 1000x full tilt weird then when you set things up such that the way the logic gates work mimic the exact rules of Game of Life itself. This creates a world where one Game of Life, set on an infinite board, looks as if it is playing The Game of Life if zoomed out far enough. Which in turn is also playing The Game of Life, and so on.

saharan created this:

Troubling, really.

🀘

CodePen

I work on CodePen! I'd highly suggest you have a PRO account on CodePen, as it buys you private Pens, media uploads, realtime collaboration, and more.

Get CodePen PRO

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to Top ⬆️