Random Walk in P5.js
Enhancement of an example in the first chapter of Daniel Shiffman's new edition of Nature of Code (2024). Each click of the mouse initiates a new "random walker" whose position is updated and drawn at each time step. At each time step, the x and y components of movement are randomly chosen but the stride length (distance moved) is fixed by the slider below the canvas.