Share your repls and programming experiences

← Back to all posts
Cellular Automata
ArchieMaclean (932)

Warning: Be careful if you have epilepsy. There are flashing/moving squares/lights. It should probably be all right, but just be careful.

Please view in fullscreen.

This is just a Cellular Automaton that generates a new ruleset when you press space. For each line of cells, each cell is either alive or dead depending on the state of the 3 cells above it in the line above, and this updates quickly. There are quite a few boring rules but a few are quite nice and apparently some have infinite complexity.

Auto-update is on by default but you can switch it off by clicking the settings icon.

Things I should probably do but won't:

  • Reduce likelihood of common rules
  • Remove boring rulesets - I have now added in basic detection so that if the rule generates a line of completely alive/dead cells for more than 1 generation, then it dies. However, this sometimes kills perfectly good rulesets, so you can disable it in the settings menu if you want.
  • Setting for length of auto-update
  • Make the settings menu look nicer
  • [Suggest more]

Here are some screenshots:

Have a play around :)
(And don't look at the spaghetti code)

eankeen (2245)

very nice! and there's nothing wrong with spaghetti🍝 :)

ArchieMaclean (932)

@eankeen Well there kind of is but :P