This was one of my first projects in JavaScript. I wanted to create a simulation that would run in the browser and render on a canvas element. I chose Langton's Ant because it was a simple set of rules that would create a complex pattern. This was a fun project to work on and I learned a lot about JavaScript and the HTML5 Canvas element.
Langton's Ant follows a set of simple rules which create a path that, despite its randomness, forms emergent order. The simulation runs within a browser and renders on a canvas element, displaying the movement of the ant as it follows its rules on a grid of cells, changing colors and directions based on the current cell's color.
- Full browser rendering using native HTML5 Canvas.
- Dynamic grid setup based on browser window size.
- Simple rule logic for Langton's Ant behavior.
- Color toggling for grid cells based on ant movement.
- Basic direction handling to navigate the grid.