{ "info": { "author": "randomdude999", "author_email": "just.so.you.can.email.me@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "========\n rule_n\n========\n\n.. image:: https://travis-ci.org/randomdude999/rule_n.svg\n :target: https://travis-ci.org/randomdude999/rule_n\n :alt: Travis CI\n.. image:: https://coveralls.io/repos/github/randomdude999/rule_n/badge.svg \n :target: https://coveralls.io/github/randomdude999/rule_n\n :alt: Coveralls\n.. image:: https://codeclimate.com/github/randomdude999/rule_n/badges/gpa.svg\n :target: https://codeclimate.com/github/randomdude999/rule_n\n :alt: Code Climate\n.. image:: https://img.shields.io/pypi/v/rule_n.svg\n :target: https://pypi.python.org/pypi/rule_n\n :alt: PyPI\n.. image:: https://img.shields.io/pypi/dm/rule_n.svg\n :target: https://pypi.python.org/pypi/rule_n#downloads\n :alt: Downloads\n.. image:: https://img.shields.io/pypi/l/rule_n.svg\n :target: https://raw.githubusercontent.com/randomdude999/rule_n/master/LICENSE\n :alt: License\n.. image:: https://img.shields.io/github/issues-raw/randomdude999/rule_n.svg\n :target: https://github.com/randomdude999/rule_n/issues\n :alt: Issues\n\nThis is a Python implementation of `elementary cellular automata`_.\n\n.. _elementary cellular automata: https://en.wikipedia.org/wiki/Elementary_cellular_automaton\n\nInstallation\n============\n\nPip\n---\n\n::\n\n pip install rule_n\n\nManual\n------\n\nDownload |rule_n.py|_ and put it somewhere in your Python path.\n\n.. |rule_n.py| replace:: ``rule_n.py``\n.. _rule_n.py: https://raw.githubusercontent.com/randomdude999/rule_n/master/rule_n.py\n\nUsage\n=====\n\n::\n\n import rule_n\n\n rule_110 = rule_n.RuleN(110)\n rule_30 = rule_n.RuleN(30)\n rule_184 = rule_n.RuleN(184) # Works with anything from 1 to 255\n rule_110 = rule_n.RuleN() # Default rule is 110, as that is the most common\n from rule_n import rule_90 # Shorthand for rule_90 = rule_n.RuleN(90)\n # Works with 110, 30, 90, 184\n # You can also specify a list of rules\n rule_110 = rule_n.RuleN([False, True, True, False, True, True, True, False])\n # Or a string that summarizes the rule\n rule_110 = rule_n.RuleN(\"01101110\")\n # See \n # You can also have a finite canvas\n rule_110_finite_canvas = rule_n.RuleN(110, canvas_size=5)\n # A canvas is finite if its size is over 0\n\n data = rule_110.process([True, False, True]) \n len(data) == 5 # because a False is added to both sides\n data == [True, True, True, True, False]\n\n data_2 = rule_110.process([1, 0, 1]) # You can use any data type, as long\n data == data_2 # as the boolean values of these are\n # correct\n # Return values are always in boolean\n\n # With a finite canvas, the output is always as big as the canvas\n data = rule_110_finite_canvas.process([0, 0, 0, 0, 1])\n data == [False, False, False, True, True]\n\n data_3 = rule_110([True, False, True]) # Shorthand for\n # rule_110.process(state)\n data == data_3\n\n i = 0\n for x in rule_110.iterate([1, 0, 1]): # Repeatedly process a state\n print x\n i += 1\n if i == 10:\n break # Please do this\n # Note: Iteration on an infinte canvas seems to have some problems\n # I recommend using a finite canvas\n for x in rule_110_finite_canvas.iterate([0, 0, 0, 0, 1]):\n print x\n # This breaks automatically if the current state is equal to the\n # previous, which will probably happen at some point on a finite canvas", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/randomdude999/rule_n", "keywords": null, "license": "GPLv3", "maintainer": null, "maintainer_email": null, "name": "rule_n", "package_url": "https://pypi.org/project/rule_n/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rule_n/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/randomdude999/rule_n" }, "release_url": "https://pypi.org/project/rule_n/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Elementary cellular automata in Python", "version": "0.2.1" }, "last_serial": 2118290, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "b6cca4174e58e50b78306fc2bd282d43", "sha256": "b806c4ca83bb2154ee2354a41ead03ab2bb36d4f9eaf7e17010f02e99cb294dd" }, "downloads": -1, "filename": "rule_n-0.1.tar.gz", "has_sig": false, "md5_digest": "b6cca4174e58e50b78306fc2bd282d43", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15669, "upload_time": "2016-05-06T16:43:47", "url": "https://files.pythonhosted.org/packages/aa/4a/52cb6f9438e90afc25f7cf13ee6a326a42b5b26a636620a7f2d7f905ec2e/rule_n-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "c22738270e8086c1fd53bc56361d943d", "sha256": "a5cd5b9575966c7a944f35f79ac0251ad9a1dfb614733a3307a6c012e6a28023" }, "downloads": -1, "filename": "rule_n-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c22738270e8086c1fd53bc56361d943d", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 18912, "upload_time": "2016-05-08T12:34:46", "url": "https://files.pythonhosted.org/packages/89/26/97a3c3a73b8dd78b737c800274600f5a70bce7b214ff4659425334bcb731/rule_n-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b8e61af2d6439e56411718de791e50f6", "sha256": "42482e292d959c3f1266c8edbff17e743226fe6c66deabac8615876a5255a4ea" }, "downloads": -1, "filename": "rule_n-0.2.tar.gz", "has_sig": false, "md5_digest": "b8e61af2d6439e56411718de791e50f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17760, "upload_time": "2016-05-08T12:34:30", "url": "https://files.pythonhosted.org/packages/03/ca/6fcd5852cf6cfc5a793c0bd81365d30e276d8ee4821a3dea1c2d19d5e100/rule_n-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "43b6821d30593a94a47a2adfb0d44bb8", "sha256": "fce2e80a79b2823189a71597d7fba5311db2a3124af20ab3cefd1e320571db31" }, "downloads": -1, "filename": "rule_n-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "43b6821d30593a94a47a2adfb0d44bb8", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7424, "upload_time": "2016-05-16T15:26:18", "url": "https://files.pythonhosted.org/packages/1e/03/0066e61add1aa7d6663aecaf9a162bca1ebb0fc9011d4982f27c5b00e49b/rule_n-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6dd674448c20496035277c56f5178ffb", "sha256": "edb6dbff652f009dd4e4e37ad4dbd1ca70d49ffe910bd286f16908e96cd20627" }, "downloads": -1, "filename": "rule_n-0.2.1.tar.gz", "has_sig": false, "md5_digest": "6dd674448c20496035277c56f5178ffb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17757, "upload_time": "2016-05-16T15:26:11", "url": "https://files.pythonhosted.org/packages/73/aa/a515959d5346c97ace31743ae88291998ab1a85d2b82a4375e9558d2683a/rule_n-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "43b6821d30593a94a47a2adfb0d44bb8", "sha256": "fce2e80a79b2823189a71597d7fba5311db2a3124af20ab3cefd1e320571db31" }, "downloads": -1, "filename": "rule_n-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "43b6821d30593a94a47a2adfb0d44bb8", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7424, "upload_time": "2016-05-16T15:26:18", "url": "https://files.pythonhosted.org/packages/1e/03/0066e61add1aa7d6663aecaf9a162bca1ebb0fc9011d4982f27c5b00e49b/rule_n-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6dd674448c20496035277c56f5178ffb", "sha256": "edb6dbff652f009dd4e4e37ad4dbd1ca70d49ffe910bd286f16908e96cd20627" }, "downloads": -1, "filename": "rule_n-0.2.1.tar.gz", "has_sig": false, "md5_digest": "6dd674448c20496035277c56f5178ffb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17757, "upload_time": "2016-05-16T15:26:11", "url": "https://files.pythonhosted.org/packages/73/aa/a515959d5346c97ace31743ae88291998ab1a85d2b82a4375e9558d2683a/rule_n-0.2.1.tar.gz" } ] }