/langtons-ant

Just an implementation of Langton's Ant in Python for fun.

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Langton's Ant

An implementation of Langton's Ant in Python for fun.

Installation

pip install lant

Dependencies

Requires Python>=3.8. For faster video writing, consider installing the conda environment, using environment.yml from the root of the git repo:

conda env create -f environment.yml

or installing opencv=4.6.0 into your existing virtual environment. The package shipped with PyPI does not use GPU acceleration.

Usage

To get started, you may invoke the program with:

ant-walk 100000 output.mp4

This produces the evolution of the ant on the grid until it walks over the edge, or the maximum number of steps is met, in this case 100k.

For more advanced usage, see the helptext:

ant-walk --help