TIL: Gilbert Curve Via

The Hilbert Curve is space-filling fractal that, in the limit, will fill any power-of-two-sized square with an increasingly dense squiggle that fills the plane.

The Gilbert Curve is a generalization of the Hilbert curve to rectangular spaces. The main code is in Python but there are also implementations in JavaScript and C.

Related: A very fast C++ Hilbert curve implementation in 2D and 3D (details here and here).