Giter VIP home page Giter VIP logo

langtons-ant's Introduction

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

langtons-ant's People

Contributors

subwayman avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

quooty

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.