Nature of code examples and exercises implemented in Lisp using trivial-gamekit.
-
You'll first have to add cl-bodge to quicklisp, as per the install instructions of trivial gamekit:
(ql-dist:install-dist "http://bodge.borodust.org/dist/org.borodust.bodge.txt")
-
Make sure quicklisp is able to detect this package (e.g. put it in
~/quicklisp/local-projects
). -
(ql:quickload :nature-of-code)
-
Run a sketch using for example
(nature-of-code.introduction.example-1:start-sketch)
. You can find these snippets in the README of each example.
Some notes:
trivial-gamekit
only supports 2D animations, so examples and exercises involving 3D are omitted.- The directory structure is set up to be easily browsable. This makes the ASDF definition kinda ugly.
- 0. Introduction
- Example I.1 - Traditional random walk
- Example I.2 - Random number distribution
- Example I.3 - Walker that tends to move to the right
- Example I.4 - Gaussian distribution
- Example I.5 - Perlin noise walker
- Example I.6 - 2D Perlin noise
- Exercise I.3 - Dynamic walker
- Exercise I.4 - Gaussian paint
- Exercise I.5 - Gaussian random walk
- Exercise I.6 - Custom distribution walk
- Exercise I.7 - Perlin noise step size walker
- Exercise I.8 - 2D Perlin noise colour
- Exercise I.9 - Moving 2D Perlin noise
- 01. Vectors
- Example 1.1 - Bouncing ball with no vectors
- Example 1.2 - Bouncing ball with vectors
- Example 1.3 - Vector subtraction
- Example 1.4 - Multiplying a vector
- Example 1.5 - Vector magnitude
- Example 1.6 - Normalizing a vector
- Example 1.7 - Motion 101 (velocity)
- Example 1.8 - Motion 101 (velocity and constant acceleration)
- Example 1.9 - Motion 101 (velocity and random acceleration)
- Example 1.10 - Acceleration towards the mouse
- Example 1.11 - Array of movers accelerating towards the mouse
- Exercise 1.4 - Vector limit
- Exercise 1.5 - Car acceleration simulation
- Exercise 1.6 - Perlin acceleration
- Exercise 1.8 - Variable acceleration towards the mouse
- 02. Forces
- Example 2.1 - Forces
- Example 2.2 - Forces acting on many objects
- Example 2.3 - Gravity scaled by mass
- Example 2.4 - Including friction
- Example 2.5 - Fluid resistance
- Example 2.6 - Attraction
- Example 2.7 - Attraction with many movers
- Exercise 2.1 - Helium-filled balloon
- Exercise 2.3 - Invisible force
- Exercise 2.4 - Pockets of friction
- Exercise 2.5 - Fluid resistance with different heights
- Exercise 2.6 - Falling boxes
- Exercise 2.7 - Multiple attractors
- Exercise 2.9 - Custom force
- 03. Oscillation
- 08. Fractals
- Example 8.1 - Recursive circles I
- Example 8.2 - Recursion twice
- Example 8.3 - Recursion four times
- Example 8.4 - Cantor set
- Example 8.5 - Koch curve
- Example 8.6 - Recursive tree
- Example 8.7 - Dynamic recursive tree
- Exercise 8.1 - Custom recursion
- Exercise 8.2 - Koch snowflake
- Exercise 8.7 - Recursive thinning tree
- Exercise 8.8 - List tree
- Exercise 8.9 - Growing tree