HilbertCurve
HilbertCurve[n] gives the line segments representing the nth-step Hilbert curve.
HilbertCurve[n, d]gives the nth-step Hilbert curve in dimensiond.
Examples
Graphics[HilbertCurve[3]]Graphics3D[HilbertCurve[2, 3]]Please visit the official Wolfram Language Reference for more details.