public void RandomizeRoom(char p) { Room temp; Room[] myAdjacentRooms; Random r = MyMap.r; int count; do { count = 0; temp = new Room(MyMap.getRandomRoom()); myAdjacentRooms = MyCave.getConnectedRooms(temp.getDecimalForm()); if (MyMap.randomizeCharacterRoom(temp.getIntegerForm(), myAdjacentRooms, p)) { count++; } } while (MyMap.isRoomNotOkay(temp, p)); if (p == 'p') { MyMap.setPlayerRoom(temp); } else if (p == 'w') { MyMap.setWumpusRoom(temp.getIntegerForm()); } }