This draws a 2D Hilbert curve. Pretty straightforward; view source for the javascript code.

iterations: