"Procedural Dungeon Generation Algorithm"
http://www.gamasutra.com/blogs/AAdon..._Algorithm.php

from just a bit of code to......