A Hilbert Scan is a path to traverse all points in a 2^n x 2^n square in a path that resembles a Hilbert Curve. Producing such a path was surprisingly tricky!
To use this Module simple
use HilbertScan; and call
2^n described previously. This function will return an array-ref of array-refs which each ref is the (x,y) pair of the coordinate of that step through the grid.