WARNING: IF YOUR COMPUTER IS AN OLD POTATO LIKE MINE, DO NOT MAKE TOO MANY PIXELS OR AGENTS.

I made an interesting simulation of slime mold. First, the simulation creates a lot of agents. These agents each have a x position, a y position, and a direction, which points to one of the eight surrounding squares. At each timestep, the agents compare the amount of pheromone in the direction it is facing and the two neighboring squares. Then, it turns in that direction and might turn randomly, and then moves in that direction. After it is done, it leaves the maximum amount of pheromone on the square it is currently on. Then, the pheromone on each square is depleted by 1 unit, and then the next timestep starts.

The original idea came from https://www.youtube.com/watch?v=X-iSQQgOd1A&t=961s.

Enter the values below and then press the Start button.

Width (ex. 500, 600):

Height (ex. 300, 400):

Pixel size (must be a factor of both width and height):

Number of Agents (ex. 10, 50):

Random turn chance (every one out of ... tries will make the agent turn):

Hope you like it.