Skip to content

nwallace/langtons-ant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Langton's Ant

This is a Clojure/Clojurescript implementation of Langton's Ant.

How to run the program in the terminal

You may specify rules for up to 9 colors using "R" to indicate a right turn and "L" to indicate a left turn.

You can run the first 100 steps with Langton's original rules like this:

lein run -- RL --steps 100

Which will produce output like this:

Example output

Additionally, you can adjust the speed of the simulation by providing the amount of time to pause between each step (in milliseconds).

Full usage

lein run -- <rules> --steps <steps> [--interval <msec>]

How to run the program in a browser

Start the file server:

lein figwheel

Then visit http://localhost:3449

How to run the tests

The project uses Midje.

lein midje will run all tests.

Credits

Ant image created by Lele Saa of The Noun Project, Creative Commons License 3.0.

About

An implementation of Langton's Ant in Clojure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published