learntosolveit/source/python/algorithm_cellauto.rst at feb4 · uthcode/learntosolveit · GitHub
Skip to content

Latest commit

 

History

History
36 lines (20 loc) · 663 Bytes

File metadata and controls

36 lines (20 loc) · 663 Bytes

Cellular Automata

Question

This generates a beautiful cellular automata pattern, following the rules of cellular automata evolution.

..image:: https://lh4.googleusercontent.com/_ny1HYbb2lDw/Tazon5TsgXI/AAAAAAAAKgU/ud6v_XhcHB0/s288/bs.png

Solution

.. literalinclude:: ../../languages/python/algorithm_cellauto.py
   :language: python
   :tab-width: 4

.. runcode:: ../../languages/python/algorithm_cellauto.py
   :language: python
   :codesite: ideone

Explanation

.. seealso::

   * :python-suggest-improve:`algorithm_cellauto.py`
   * :python-better-explain:`algorithm_cellauto.rst`