Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 1.84 KB

README.md

File metadata and controls

31 lines (26 loc) · 1.84 KB

1 Dimensional Cellular Automata

For more details about cellular automata: Wolfram Alpha, Wikipedia, Explanation with code (natureofcode).
This is a simple 1Dimensional cellular automata visualized using matplotlib.pyplot.

How to use

-Install matplotlib (To install matplotlib use pip install matplotlib on your command line) -Run this file and enter the rule see what is rule -wait for the output

Here are a few results:

  1. Rule 60
    image

  2. Rule 90
    image

  3. Rule 73
    image

Note that the initial generation is taken to just have 1 live cell at the center.

How to play my code:

  • you can change the initial state by manually changing the variable current declared in the python file. By default it is set to 499 zeros and only one 1 at the center.
  • my code only thinks about the nearest neighbour (i.e. left and right), maybe you can care about cells which are the neighbour of the nearest neighbours. In that case there will be 232 rules possible, which is equivalent to 4294967296 rules and you can just choose any. Think about how many cool patterns (and other things) you can generate from it.
    Here is an example of state 887847937
    image