Wednesday, November 22, 2017 18:14

C++ Cellular Automaton

This is another fairly simple opengl program for the rules given by Conway’s Game of Life. There are all kinds of cool patterns you can make, like in the picture above is 2 glider guns where the glider streams are colliding continuously forever (check out the wiki link for more info and the rules). In the program itself I have implemented a save and load system and a lot of cool patterns I made already I saved in a “saves” folder in the download.

I tried to make it as simple as possible without having to use anything other than glut menus and keyboard input, and I think I did fairly well. The program itself is very functional (apart from some minor bugs) but highly unoptimized. If I had time there are some very simple and obvious improvements that could be made. As it is, it checks every square regardless of what is next to it. Also, the grid could easily be dynamically sized to the maximum width of the cells, as the grid itself is just a vector of a vector. It is not too noticeable (about 1 second per 1000 generations).

It does do a few things other cellular automaton programs don’t do, like save a history (so you can backtrack through the generations).

If I ever get really bored I might fix slowness, but for now:

Download it here.

One Response to “C++ Cellular Automaton”

  1. James says:

    You realise nobody cares, right? About any of this?

Leave a Reply