All Projects → zmwangx → rule30

zmwangx / rule30

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

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to rule30

compiler-design-lab
These are my programs for compiler design lab work in my sixth semester
Stars: ✭ 47 (+88%)
Mutual labels:  theory-of-computation

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:

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

License

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].