Chapter 0 of The Nature of Code, Randomness, builds a random walker and shows that its behavior is set by the probability distribution its steps are drawn from. Here the step length is drawn from real earthquake magnitudes rather than a chosen distribution.
USGS weekly magnitudes already have that heavy tail, so I use them as the walker’s step lengths instead of sampling a synthetic Levy distribution.
Earthquake magnitudes follow the Gutenberg-Richter law: the number of events falls exponentially with magnitude, and radiated energy grows exponentially. The walker’s step length is \(\ell = 3\cdot 10^{\,M-2.5}\) (clamped for the canvas), so most steps are short and rare large quakes produce long jumps. That heavy-tailed step distribution is a Levy flight in length, the non-Gaussian case Chapter 0 contrasts with uniform and normal walks.
The Gutenberg-Richter law is \(\log_{10} N = a - bM\), where \(N\) is the number of events of magnitude at least \(M\) and \(b \approx 1\); radiated seismic energy scales as \(E \propto 10^{1.5M}\). Each move advances along a persistent heading that wanders by a small Gaussian nudge, \(\mathbf{x}_{t+1} = \mathbf{x}_t + \ell\,(\cos\theta_t, \sin\theta_t)\) with \(\theta_{t+1} = \theta_t + \varepsilon_t\), \(\varepsilon_t \sim \mathcal{N}(0,\sigma^2)\). The Levy character is in the step lengths, not in independent uniform headings each frame.
Data source: USGS Earthquake Hazards Program
Endpoint:https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojson
Access: Public, no key. Loaded from an hourly server-side refresh when possible, with a bundled snapshot fallback, and a live browser fetch only when the API allows CORS. Data window: Jul 30, 2026 - Aug 6, 2026 (pulled Aug 6, 2026 UTC)
All 389 earthquakes are listed below.