See the Pen on CodePen.

The drunkard's walk algorithm for basic dungeon generation