Skip to content

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.

Installation

To install from PyPI:

pip install rule30

To install and develop from this repository:

./setup.py develop

API reference

See rule30.zhimingwang.org.

Console script

$ 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

See also

Images

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:

image

Rule 50:

image

Rule 54:

image

Rule 60:

image

Rule 62:

image

Rule 90:

image

Rule 94:

image

Rule 102:

image

Rule 110:

image

Rule 126:

image

Rule 150:

image

Rule 158:

image

Rule 182:

image

Rule 188:

image

Rule 190:

image

Rule 220:

image

Rule 222:

image

License

Copyright (c) 2017 Zhiming Wang <zmwangx@gmail.com>

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