Math
Chaos game
A die and a jump toward a random corner build a fractal nobody drew - Sierpinski's triangle, the fern, the dragon, the Menger sponge - the same from any start; drag the corners, change the jump, count the boxes and measure its dimension.

What happens
Choose a corner at random and move the point a fixed fraction towards it. Repeating this local rule produces a fractal. In the triangle preset, a half-distance jump generates the Sierpinski attractor after initial transients.
Two points driven by the same corner sequence forget their initial separation: for half-distance jumps their distance after k steps is d_k = d_0·(1/2)^k, where d_0 is their starting distance. This exact contraction concerns paired trajectories under the same rule, not two independent random sequences. Drag a corner to replay the remembered choices with new geometry.
Compare the triangle, tetrahedron, constrained square, pentagon, fern, dragon, Koch and Menger presets. Box counting estimates a dimension from the finite point cloud. The similarity formula D = log(n)/log(1/c) applies to n copies with a common contraction c under the appropriate separation assumptions; it is not a universal dimension formula for overlapping or unequal affine maps.
Equations used in the module
Equations game: x ← x + r·(v − x) = (1 − r)·x + r·v toward a random corner v; jump r, contraction c = 1 − r; general form x ← A_i·x + b_i with probability p_i (an iterated function system) forgotten start: two points x, y under the same die: |x_k − y_k| = c^k·|x_0 − y_0| exactly for similarities - after 20 halvings 1.79·10^−6 of the original 1.88; the fern (not a similarity) contracts to 2.4·10^−5 of 5.26 in 40 jumps hole: at r = 1/2 the middle quarter of the triangle is exactly empty (0 of 50 000 points after the burn-in); at r = 0.45 the copies scale by 0.55, overlap, and 10 435 of 50 000 land there; at r = 0.55 the hole widens dimension: boxes of side 2^−k over the bounding cube; N(k) ∝ 2^(k·D); D = slope of log2 N against k, fitted over k = 4 … 7 (flat) or 3 … 5 (space); Moran: n copies of ratio c that do not overlap have Σ c^D = 1, D = log n / log(1/c) presets: triangle log3/log2 = 1.585 (measured 1.60 on 200 000 points); tetrahedron 2 (1.90); square without repeats, three choices of 1/2: log3/log2 (1.586); pentagon at r = 1/φ, c = 1/φ²: log5/log φ² = 1.672 (1.64); fern - no similarity dimension (1.81); dragon, two maps of 1/√2: 2 (1.80); Koch, four of 1/3: log4/log3 = 1.262 (1.34); Menger, twenty of 1/3: log20/log3 = 2.727 (2.79) fern: A₁ = [[0, 0], [0, 0.16]], p = 0.01; A₂ = [[0.85, 0.04], [−0.04, 0.85]], b = (0, 1.6), p = 0.85; A₃ = [[0.20, −0.26], [0.23, 0.22]], b = (0, 1.6), p = 0.07; A₄ = [[−0.15, 0.28], [0.26, 0.24]], b = (0, 0.44), p = 0.07 die: the shared xorshift; 20 jumps of burn-in are not recorded; start (0.1, 0.2), z = 0.3 in space


