Langton's ant

A javascript program that simulates Langton's ant.
Stack: P5js

Langton's ant

This program tries to simulate the emerging behavior of the Langton ant. The ant is "destined" to follow a path called "The highway". More about this in this video by numberphile.

Drag your mouse around the canvas to set obstacles in its journey and see if you can prevent it from following this path.

The program was written in P5 , a javascript library for creating beautiful visual animations and creative coding.

Here is demo video.

source code