Hilbert Curve Turtle Graphics

For a homework assignment in college we had to use a Java turtle graphics API to draw some art.

I thought it would be interesting to find a way to draw arbitrary bitmaps. So I wrote a program that generated a Java programs with a large array containing instructions for the turtle based on an input image. To generate the instructions I had the turtle follow a path along a Hilbert space-filling curve and sample the image at each point. The turtle could have just sampled the image in a raster pattern (back and forth horizontally) but I thought it was more interesting to watch if it followed the Hilbert Curve.

Made while in undergrad