Finishde the dungeon generation algorithm in Javascript