[originally from svn r5860]
grid generation to arrange a mine layout that never requires guessing. [originally from svn r5859]