Skip to content
/ rule30 Public

Python implementation of Stephen Wolfram's elementary cellular automata (in particular, Rule 30)

License

Notifications You must be signed in to change notification settings

zmwangx/rule30

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rule30

GitHub release PyPI version Supported Python versions Docs License

This project efficiently implements Stephen Wolfram's elementary cellular automata (Rule 30 being a notable example), specifically their single 1 histories. Histories can be generated in various matrix formats (including numpy.ndarray) and exported as strings or images.

To install from PyPI:

pip install rule30

To install and develop from this repository:

./setup.py develop

See rule30.zhimingwang.org.

$ rule30 --help
usage: rule30 [-h] [-n ROWS] [-r [RULE]] [-s BLOCK_SIZE] [--version] [--debug]
              image

Generate images for the single 1 histories of Stephen Wolfram's elementary
cellular automata.

positional arguments:
  image                 path to the output image (PNG format)

optional arguments:
  -h, --help            show this help message and exit
  -n ROWS, --rows ROWS  number of rows to generate; default is 256
  -r [RULE], --rule [RULE]
                        Wolfram code of the rule (between 0 and 255); default
                        is 30
  -s BLOCK_SIZE, --block-size BLOCK_SIZE
                        the size in pixels for each cell; default is 1
  --version             show program's version number and exit
  --debug               enable debug messages

Here are the images for some interesting rules with individual pages on Wolfram MathWorld. Images for all 256 rules can be found in the images directory.

Rule 30:

images/rule30.png

Rule 50:

images/rule50.png

Rule 54:

images/rule54.png

Rule 60:

images/rule60.png

Rule 62:

images/rule62.png

Rule 90:

images/rule90.png

Rule 94:

images/rule94.png

Rule 102:

images/rule102.png

Rule 110:

images/rule110.png

Rule 126:

images/rule126.png

Rule 150:

images/rule150.png

Rule 158:

images/rule158.png

Rule 182:

images/rule182.png

Rule 188:

images/rule188.png

Rule 190:

images/rule190.png

Rule 220:

images/rule220.png

Rule 222:

images/rule222.png

Copyright (c) 2017 Zhiming Wang <[email protected]>

This project is licensed under the MIT license. See COPYING for details.

Images in the images directory are separately licensed under CC0 1.0 Universal.

About

Python implementation of Stephen Wolfram's elementary cellular automata (in particular, Rule 30)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published