private int roomToInt(Room r) {
		int result = 0;
		for(int i = 0; i < r.doors.length; i++) {
			Door d = r.doors[i];
			switch (d.dir) {
			case DOWN:
				result += 2 * (d.isWall ? 1 : 0);
				break;
			case LEFT:
				result += 4 * (d.isWall ? 1 : 0);
				break;
			case RIGHT:
				result += 8 * (d.isWall ? 1 : 0);
				break;
			case UP:
				result += 1 * (d.isWall ? 1 : 0);
				break;
			default:
				break;			
			}
		}
		return result;
		
	}