Skip to content

This is a simple 1Dimensional cellular automata visualized using matplotlib.pyplot. The rules can also be manipulated. This program has a rulebook modification for accepting 32 bit rules

License

Notifications You must be signed in to change notification settings

Anindya-Prithvi/cellular_automata1D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

This is a simple 1Dimensional cellular automata visualized using matplotlib.pyplot. The rules can also be manipulated. This program has a rulebook modification for accepting 32 bit rules

Topics

Resources

License

Stars

Watchers

Forks

Languages