Coder Social home page Coder Social logo

zmwangx / rule30 Goto Github PK

View Code? Open in Web Editor NEW
30.0 2.0 0.0 1.36 MB

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

Home Page: https://rule30.zhimingwang.org

License: MIT License

Shell 6.12% Python 93.88%
visualization theory-of-computation

rule30's Introduction

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.

rule30's People

Contributors

zmwangx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.