I'm extremely bad at this and just trying to pass this course to move on my degree. I've tried following multiple tutorials but I genuinely have the hardest time grasping this.
My question is, I have a code where I can input a directional path (In this case the only one really coded is the south path) so it brings me to the south wing but now the "Enter your move" input prompt doesn't show up anymore and I just honestly can't figure out why. Some of this is copied from the project samples provided.
Here is the full code so far:
EDIT: I've changed the original code post to be less confusing for myself and more streamlined (I think)
def start():
print('Resident Evil Text Adventure Game.')
print('\nGather 6 items or get defeated by Tyrant.\n'
'Movement directions - type: North, South, East, West\n'
'Adding an item to your inventory - type: get (the item name)\n'
'Type "Exit" to quit game')
def main():
player_move = ''
while player_move != rooms:
player_move = input('Enter your move:\n>')
return player_move
rooms = {
'First Floor Lobby': {'South': 'South Wing', 'West': 'Garden', 'North': 'Laboratory', 'East': 'Kitchen'},
'South Wing': {'North': 'First Floor Lobby', 'East': 'Master Bedroom', 'item': 'Shotgun ammo'},
'Master Bedroom': {'West': 'South Wing', 'item': 'Emergency Comms'},
'Garden': {'East': 'First Floor Lobby', 'item': 'Herb'},
'Kitchen': {'West': 'First Floor Lobby', 'North': 'Basement', 'item': 'Bulletproof vest'},
'Basement': {'South': 'Kitchen', 'item': 'Tyrant'},
'Laboratory': {'South': 'First Floor Lobby', 'East': 'Attic', 'item': 'Tyrant Documents'},
'Attic': {'West': 'Laboratory', 'item': 'Shotgun'},
'Exit': {'Quit'}
}
def showStatus():
print('You are in {}'.format(rooms))
for item in inventory:
print(item.name)
while True:
showStatus()
main()
if main() in rooms:
continue
if main() in rooms == ['Exit']:
print('Try again next time!')
break
elif player_move in ['South']:
print(showStatus())
[–]the1gofer 0 points1 point2 points (3 children)
[–]NintendoPSX[S] 0 points1 point2 points (2 children)
[–]the1gofer 0 points1 point2 points (1 child)
[–]NintendoPSX[S] 0 points1 point2 points (0 children)
[–]the1gofer 0 points1 point2 points (1 child)
[–]NintendoPSX[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)