This was a project I did over the course of a week or two in college for a graphics course. Whenever I think about doing a project for something like a game or something else that requires a large amount of content, I always find the creation of that content potentially tedious and bothersome to have to create. I usually see if it's possible to solve this problem like most of the other software problems I have, with an algorithm.
This was done right around the time the first version of Minecraft was released. Obviously, Minecraft is a much more full featured, well thought-out, implementation of this principle.
The source code is available on GitHub.