Optimized nextRoom() to use input instead of if statements