Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help me with my python code? Im struggling to figure out how its not flowing into each catagory. When entering different words, such
Can someone help me with my python code? Im struggling to figure out how its not flowing into each catagory. When entering different words, such as the directions it doesnt pick it up and it just proceeds through the game list.
room1 = input('You are in the Deans Office: What direction do you want to go? (North, East, South, West): ') room2 = input('You are in the Gallery: What direction do you want to go? (North, East, South, West): ') room3 = input('You are in the Nurses Office: What direction do you want to go? (North, East, South, West): ') room4 = input('You are in the Classroom: What direction do you want to go? (North, East, South, West): ') room5 = input('You are in the Bathroom: What direction do you want to go? (North, East, South, West): ') room6 = input('You are in the Storage Room: What direction do you want to go? (North, East, South, West): ') room7 = input('You are in the Utility Closet: What direction do you want to go? (North, East, South, West): ') room8 = input('Oh no! Its the security Guards! You have been caught!') class instructions(): print("Supply run! Are you ready?", end=' ') print("Collect 6 items to escape the school, must complete without being caught by the guards!", end=' ') print("Move commands, just say: South, North, East, West", end=' ') print("Add to Inventory: enter 'Gather_RoomItem' ") new_game = input('Ready to get your supplies back? We start in the Deans office! (Yes or No, y/n): ') if new_game == 'n' or new_game == 'N': print('Have a good day!') elif new_game != 'y' or new_game != 'Y': print(new_game) direction = input('You are in the Deans office! Please choose a direction: (North, South, East, West):') def room1(): print('You are here in the Deans office! ') print('To the east we have the only room, the Gallery') # if direction == 'East': # print('You are now the Gallery!') # elif direction == 'South': # print('You can not go that way!') # elif direction == 'North': # print('You can not go that way!') # elif direction == 'West': # print('You can not go that way!') def room2(): print('You are in the Gallery: ') print('To the North is the Storage Room. ') print('To the East is the Classroom. ') print('To the South is the Nurses office. ') print('To the West is the Deans office.') # if direction == 'North': # print('You are now in the Storage room!') # elif direction == 'South': # print('You are now in the Nurses office!') # elif direction == 'East': # print('You will end up in the Deans office again!') # elif direction == 'West': # print('You are now in the Classroom!') def room3(): print('You are in the Nurses office: ') print('To the North is the Gallery. ') print('To the East is the Lunch room....Beware the guards are in there! ') print('To the South is Nothing! ') print('To the West is Nothing!') # if direction == 'North': # print('You are in the Gallery again!') # elif direction == 'South': # print('You can not go that way!') # elif direction == 'East': # print('You dont want to enter there! Its the security guards!') # elif direction == 'West': # print('You can not go that way!') def room4(): print('You are in the Classroom: ') print('To the North is the Bathroom ') print('To the East is the Nothing! ') print('To the South is Nothing! ') print('To the West is the Gallery') # if direction == 'North': # print('You are in the Bathroom!') # elif direction == 'South': # print('You can not go that way!') # elif direction == 'East': # print('You can not go that way!') # elif direction == 'West': # print('You are now back in the Gallery!') def room5(): print('You are in the Bathroom:') print('To the North is Nothing ') print('To the East is Nothing ') print('To the South is the Classroom ') print('To the West is Nothing') # if direction == 'North': # print('You can not go that way!') # elif direction == 'South': # print('You are now in the Classroom!') # elif direction == 'East': # print('You can not go that way!') # elif direction == 'West': # print('You can not go that way!') def room6(): print('You are in the Storage Room:') print('To the North is Nothing ') print('To the East is the Utility Closet ') print('To the South is the Gallery ') print('To the West is Nothing!') # if direction == 'North': # print('You can not go that way!') # elif direction == 'South': # print('You are now in the Gallery again!') # elif direction == 'East': # print('You are now in the Utility closet!') # elif direction == 'West': # print('You can not go that way!') def room7(): print('You are in the Utility Closet: ') print('To the North is Nothing ') print('To the East is Nothing ') print('To the South is Nothing ') print('To the West is the Storage room') # if direction == 'North': # print('You can not go that way!') # elif direction == 'South': # print('You can not go that way!') # elif direction == 'East': # print('You can not go that way!') # elif direction == 'West': # print('You are back in the Storage room.') def room8(): print('You are in the Lunch room: ') print('The security guards have caught you and kicked you out of the school! Better luck next time!') while True: if direction == 'East': room2() print('You have entered the Gallery!') elif direction == 'South': print('Wrong Way') elif direction == 'North': print('Wrong way') elif direction == 'West': print('Wrong Way') break while direction == 'North': room6() print('You are now in the Storage Room!') if direction == 'South': room3() print('You are now in the Nurses Office!') elif direction == 'East': room4() print('You are now in the Classroom!') elif direction == 'West': room1() print('You are back in the Deans office!') break while direction == 'North': room2() print('You are now back in the Gallery!') if direction == 'South': print('You can not go that way!') elif direction == 'East': room8() print('Oh No! The guards have gotten you!') elif direction == 'West': print('You can not go that way!') break while direction == 'North': room5() print('You are now in the Bathroom!') if direction == 'South': print('You can not go that way!') elif direction == 'East': print('You can not go that way!') elif direction == 'West': room2() print('You are back in the Gallery!') break while direction == 'North': print('You can not go that way!') if direction == 'South': room4() print('You are now back in the Classroom!') elif direction == 'East': print('You can not go that way!') elif direction == 'West': print('You can not go that way!') break while direction == 'North': print('You can not go that way!') if direction == 'South': room2() print('You are now back in the Gallery!') elif direction == 'East': room7() print('You are now in the Utility Closet!') elif direction == 'West': print('You can not go that way!') break while direction == 'North': print('You can not go that way!') if direction == 'South': print('You can not go that way!') elif direction == 'East': print('You can not go that way!') elif direction == 'West': room6() print('You are now back in the Storage Room!') break
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started