AI suggested improvements to Conway’s Game of Life

Conway's Game of Life
Screenshot of the a terminal displaying Conway’s Game of Life.

Conway’s Game of Life is a fun little simulator of life using cells (blocks) to represent a life form. When a given cell has the right number of neighbors it comes to life and if it has too few or too many neighbors, it dies. There are a many blog posts out there that can help you get started creating your own Game of Life (GoL). Some are written in Python and use pygame I’ve checked out others that use the terminal to display a grid with text.

Geeks for Geeks – Conway’s Game of Life Python Implementation

beltoforion.de – John Conways “Game of Life” in Python

PasiduPerera – Game of Life in Python

A normal version of Conway’s Game of Life

Part of the beauty of GoL is that complexity and structures can arise from the simple execution and enforcement of just three basic rules. It did make me wonder if there is a way to make it generate more complexity just to see what happens. So I threw the question at ChatGPT. I asked it how the rules of GoL could be modified to result in a more expressive outcome. Here is basically what it suggests:

  • Add mutations
  • Increase competition
  • Raise the overpopulated threshold from 3 to something like 6 or 7

Some of these suggestions are easier than others to implement. The mutation idea is really interesting to me because you see that in the biological world, so I could imagine getting more diversity of behavior out of that. This might be involve introducing some probability that the cell doesn’t follow each rule each time it’s evaluated.

I’ve placed a simple version of GoL in a repo for anyone that is interested
https://github.com/Davesjoshin/CGoL

Life finds a way

Life finds a way

I introduced a small chance every time a cell is evaluated that it will survive or come to life no matter what. I first tried a 5% of a cell getting this pass, but that seemed to just create general chaos. The game almost looked like white noise. So I lowered it to a 0.1% chance and that seems to run a bit smoother.

This seems to have a couple of effects you can see right way. First, random cells in the void come to life for a cycle and the disappear. Secondly, permanent structures eventually get disrupted and destroyed.

I created a branch in the repo for this slight mutation, keeping the main branch to the normal CGoL rules.

https://github.com/Davesjoshin/CGoL/tree/ai-mutations

Comment section

Leave a Reply

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

caret-downclosefacebook-squarehamburgerinstagram-squarelinkedin-squarepauseplaytwitter-square