DEV Community

Cover image for Conway's Game Of Life with different rules
Alex Jacobs
Alex Jacobs

Posted on • Edited on

Conway's Game Of Life with different rules

Conway's Game Of Life

The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970

If you've spent any time exploring or playing with Conway's Game Of Life, you're probably very familiar with resulting pattern such as:

game of life representative end state

But what if you could play with the settings that determine the rules for each turn, and could create patterns such as this?

game of life and state with different rules

Now you can!

Here is a deployed version of the project that is up and running that you can play with

I've created a game of life explorer using JavaScript that lets you change the rules.

The default rules are:

  • Death by overpopulation if neighbors are greater than 3
  • Death by under population if neighbors are less than 2
  • Rebirth by reproduction if neighbors exactly equal 3

I've also created simple editing tools that let you add or delete individual cells, play and pause during the evolution of the game, move your cells around on the game board, and also select random starting patterns. You can also change your initial board size, and of the millisecond delay between turns.

This allows you to make interesting starting patterns such as the following:
(scroll to 30 seconds to see the pattern get much more complex and interesting)

You can explore the code at my repository at:

GitHub logo lexjacobs / conways-game-of-life-explorer

Exploring Conway's Game of Life with variable board sizes, and alternate rules.




I hope you enjoy exploring this project and enjoy learning more about The Game Of Life.

Please let me know what you think!

Top comments (1)

Collapse
 
lexjacobs profile image
Alex Jacobs

I especially love the following settings:

because they allow you to create incredible snowflake-like patterns with ease, such as: