p5.js sketches
Everything started from the flocking tutorial written by Robert Hodgin and some of the Cinder crew.
The idea is that with simple rules one can simulate complex group behaviors. Craig Reynolds was the first one to put these ideas into computer animations back in 1986.
In addition to p5.js, this sketch makes use of the dat.GUI JavaScript library to display the controls.
For more details, check the source code or play with it at JSFiddle.