-
Description: This repository contains an index.html file and a sketch.js file which can be viewed on the local server.
-
About the simulation: The canvas starts with a square grid, click anywhere to spawn the ant. And if the ant is already spawned and on the grid, click anywhere to change the ant's position. There are two slider on the top left, the first one can be used to change the ant's speed (antsteps/frame) range 1 to 40 units. Second one can be used to change the framerate (frames/second) range 1 to 80 units.
-
Optional: The square grid is easily scalable, this can be done by changing the value of variable
sqLen
in line 5 (in sketch.js). The constraints onsqLen
: The value should be a factor of both canvas height and canvas width. The value should be even. -
References: Langton's ant, p5js