The Nature of Code

Coursework submissions for The Nature of Code course on Kadenze (Sep.-Oct. 2018)


Back in the days when Processing was Java I first studied through Daniel Shiffman’s The Nature of Code, fascinated by particles and physical simulation. Years later, on late summer 2018, I took the MOOC version of it on Kadenze, this time working with the JavaScript implementation p5.js, for refreshment and to get back into creative coding.

p5.js is used under GNU LGPLv2.1.

The Projects

The five small projects here comprise the coursework across different topics, beginning with simple ideas and increasing in complexity.

  1. Random Walker: just a simple exercise of a creature chasing an imaginary creature. Nothing impressive, but the bug is cute [src]
  2. Physics: a colorful user-controlled animation of flowers that simulates gravity and wind [src]
  3. Steering Forces: a zoo with wondering carnivores and herbivores that lose energy and die if they don’t get their food [src]
  4. Fractal Design: a generator of a static grid of (partially) fractal squares, with several color palettes [src]
  5. Genetic Algorithms: A visually minimalist game of spaceship-shooting where the ships evolve to become better at surviving [src]

There is some inconsistency with the use of the p5.js library, since in the first two assignments I’ve used the most recent version, while only afterwards I saw that I needed to use an older version provided by the course in order for it to run in the course website (due to ES6 incompatibility).