code

Projects and code experiments.

🎲 random demo →

generative & visual

  • game of life →

    Conway's Game of Life running in a canvas, wrapping at the edges. Click or drag to draw β€” it pauses while you do.

  • cellular automaton →

    An elementary (1D) cellular automaton explorer β€” pick a rule, pick a seed, watch it unfold.

  • noise generator →

    Four kinds of procedural noise, from pure static to layered Perlin β€” same underlying hash function, different amounts of structure.

  • sdf raymarcher →

    A scene made of nothing but distance functions, rendered by marching rays through them one step at a time β€” no meshes, no triangles, no three.js.

  • boids →

    Flocking from three local rules β€” switch each one off and watch an order parameter report exactly what it was doing.

  • reaction-diffusion →

    The Gray-Scott model: two virtual chemicals react and diffuse across a grid, producing self-organizing spots, stripes, and coral from a few lines of math.

audio

  • drum machine →

    A 16-step sequencer with synthesized drum sounds β€” no samples, just oscillators and filtered noise through the Web Audio API.

  • euclidean rhythm →

    Bjorklund's algorithm distributes N hits as evenly as possible across M steps β€” a natural sibling to the drum machine, generated rather than hand-programmed.

  • karplus-strong →

    Plucked-string synthesis from a noise burst circling a short delay line β€” no samples, the waveform itself is the algorithm.

  • additive synth →

    Build a tone by drawing its harmonics one bar at a time β€” Fourier's theorem as an instrument, ripple and all.

  • fft spectrum →

    A live spectrum analyser fed by the same voices the drum machine and Karplus-Strong pages use β€” synthesis seen from the other side.

formal systems

  • regex visualizer →

    A small regex engine that compiles patterns to an NFA via Thompson's construction, and renders the graph live.

  • turing machine →

    A simulator for a real Turing machine β€” an unbounded tape, a read/write head, and a handful of states β€” running four small preset programs.

  • lambda reducer →

    An untyped lambda calculus interpreter β€” step through beta-reductions on a syntax tree, watching Church encodings and combinators unfold.

  • pushdown parser →

    A recursive-descent parser with its stack and syntax tree exposed β€” the context-free rung between the regex engine and the Turing machine.

  • markov text →

    An n-gram Markov chain trained on this site's own prose β€” raise the order and watch it go from noise to fluent to plagiarism, with the copied runs highlighted.

math & cryptography

  • monty hall →

    The classic three-door probability puzzle β€” play it by hand, or simulate a few hundred rounds and watch switching pull ahead.

  • nash equilibrium →

    A 2Γ—2 game solver next to a live phase portrait β€” edit the payoffs, see every equilibrium, and watch whether the dynamics actually reach one.

  • vigenΓ¨re cipher →

    A polyalphabetic cipher, and the classical frequency-analysis attack that breaks it β€” watch the key get recovered letter by letter.

  • huffman coding →

    Build the code tree one merge at a time, watch frequent symbols collect short codes, and compare the result against the entropy it is chasing.

  • hash collision →

    Real SHA-256, truncated short, colliding in seconds β€” a demonstration of why hash outputs are as long as they are.

  • enigma →

    A working Wehrmacht Enigma I, with the signal traced through every rotor β€” and the flaw in it that Turing turned into a machine.