Langton’s Ant in p5.js

Simon wrote this JavaScript code for Langton’s Ant (a type of Cellular Automaton) himself, inspired by Daniel Shiffman’s description/version in Processing (Java) during the Coding Train live stream on January 5.

Link to Simon’s sketch: http://alpha.editor.p5js.org/simontiger/sketches/rJeKLICmM

Simon later also made a pixel level version: http://alpha.editor.p5js.org/simontiger/sketches/rJeKLICmM

And a version with multiple ants: http://alpha.editor.p5js.org/simontiger/sketches/r1Ry_FQ4M

(Simon also loves the Numberphile video about how Langton’s Ant works and forms a mysterious “highway” after a certain number of moves).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s