Skip to content

A simulator for Langton's Ant, made using a Python wrapper for the FLTK Toolkit.

License

Notifications You must be signed in to change notification settings

SubwayMan/langtons-ant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Langton's Ant

Langton's Ant is a simple set of rules that are imposed on an "ant" moving through a grid, leading to complex emergent behaviour.

Program Features

  • Simulate behaviour of Langton's Ant
  • Change rules to observe varying emergent behaviour
  • Simulate at varying speeds

Program use

  • To get the code onto your machine, you can download git and directly clone this repository. This simulation requires PyFLTK preinstalled.
  • If you have never used Git before, you can instead copy-paste the source code onto your own machine, save it as a new python script, and run it from there. Only the src/LangtonsAnt.py code is necessary.
  • If using git, run simulation by going to the src directory and running the main script Langton.py.
  • Simulation can be started/paused with buttons. Upon pause, simulation can also be reset.
  • Loaded simulation can be changed from the menu. Accepts a string of length 2-12 comprising of characters ["L", "R"] (case sensitive)
  • Simulation speed can be controlled using slider on the bottom. slider is logarithmic, ranging from 1-0.001s. (Innacurate, likely due to bottleneck from FLTK draw speeds)

License

This program was constructed using a Python wrapper for the FLTK toolkit. Software is issued under an MIT License.

Examples

RL (Default)

Image1

LRRL

Image2

LRLLRR

Image3

Todos

  • Add multiple "ant" states functionality
  • Add Hexagonal grid mode
  • Fix logarithmic speed slider to go down to 1 millis

Further Reading

Langton's Ant - Wikipedia

About

A simulator for Langton's Ant, made using a Python wrapper for the FLTK Toolkit.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages