private void enterRoom(Room[][] rooms, int x, int y) {
        if (validPosition(rooms, x, y) && !rooms[x][y].visited) {
            rooms[x][y].visited = true;
            List<Dir> dirs = new ArrayList<MapBuilder.Dir>(EnumSet
                    .allOf(Dir.class));
            
            this.shuffle(dirs);
            for (Dir dir : dirs) {
                int deltaX = 0;
                int deltaY = 0;
                switch (dir) {
                case UP:
                    deltaY = -1;
                    break;
                case DOWN:
                    deltaY = 1;
                    break;
                case RIGHT:
                    deltaX = 1;
                    break;
                case LEFT:
                    deltaX = -1;
                    break;
                }
                if (validPosition(rooms, x + deltaX, y + deltaY)) {
                    if (!rooms[x + deltaX][y + deltaY].visited) {
                        rooms[x][y].walls[dir.getNum()] = true;
                        enterRoom(rooms, x + deltaX, y + deltaY);
                    } else {
                        rooms[x][y].walls[dir.getNum()] = rooms[x + deltaX][y
                                + deltaY].walls[dir.getOp()];
                    }
                } else {
                    rooms[x][y].walls[dir.getNum()] = false;
                }
            }
        }
    }