A collection by Michael Casagranda
Magic Book of Algorithms
A notebook about algorithms: briefly explained, written in readable C# and shown with an example that really ran.
- Algorithms
- 19
- Groups
- 9
- Language
- C# / .NET 10
Sorting
Bringing data into order. The classic playground for understanding running time.
Searching
Finding something specific without looking at everything.
Pathfinding
Finding the cheapest way from here to there when not every step costs the same.
Mathematics
Number sequences and calculations that show up in surprisingly many programs.
Statistics
What many numbers tell together, even when the single number says nothing.
Randomness & Noise
Calculated randomness: reproducible, fast and the basis of procedurally generated worlds.
PCG (Random Numbers)
A random generator in a handful of lines: fast, evenly spread and reproducible at any time.
RND-02Perlin Noise
Raw randomness turns into smooth noise, the raw material for landscapes, clouds and textures.
RND-03Worley Noise
Scatter points, measure distances — and out come cells, scales and cracked ground.
Procedural generation
Building worlds, maps and patterns from rules instead of by hand.
Compression
Storing the same information in less space.
Image processing
Turning pixels into something else: filtering, converting, redrawing.
Weighted Voronoi Stippling
A picture made of nothing but dots: dense where it is dark, sparse where it is light.
IMG-02Dithering
Few colours that look like many from a distance.
IMG-03Edge Detection
Sobel, Prewitt, Laplace and Canny: four answers to where something in a picture begins.
IMG-04Bloom
Bright things spill over their edges — a flaw of optics, rebuilt in three lines.
IMG-05Marching Squares
A field of numbers turns into a line: sixteen cases, and no more than that.