Def player_stats():
print('Inventory: []')
print('----------------------')
print("Enter your move:\\")
rooms = {
'great hall': {
'north': 'bedroom',
'south': 'dining room',
'east': 'kitchen',
'west': 'library',
'contents': [],
'name': 'Great Hall',
'text': 'You see no items'},
'library': {
'name': 'library',
'east': 'great hall',
'text': 'You see a book',
'contents': 'book'},
'dining room': {
'name': 'dining room',
'text': 'You see a shield',
'north': 'great hall',
'east': 'cellar',
'contents': 'shield'},
'bedroom': {
'name': 'bedroom',
'text': 'You see fire',
'south': 'great hall',
'east': 'bathroom',
'contents': 'fire'},
'bathroom': {
'name': 'bathroom',
'text': 'You see a helmet',
'west': 'bedroom',
'contents': 'helmet'},
'cellar': {
'name': 'cellar',
'west': 'dining room',
'contents': 'Armor'},
'dungeon': {
'text': 'You see no items',
'name': 'dungeon',
'south': 'kitchen'},
'kitchen': {
'name': 'kitchen',
'text': 'You see raw beef',
'north': 'dungeon',
'west': 'great hall',
'contents': "raw beef"}
}
directions = ['north', 'south', 'east', 'west']
inventory = []
# output the player for instructions
current_room = rooms['great hall']
# If the player wants to exit the game
# loop for moving between rooms
# loop for moving between rooms
while True:
print()
print('You are in {}.'.format(current_room['name']))
print(current_room['text'])
command = input('What do you do?\\').strip()
if current_room['contents']:
print("In the room are: {}.".format(', '.join(current_room['contents'])))
if command in directions:
if command in rooms:
current_room = rooms[current_room[command]]
else:
print("You can't go that way.")
elif command.lower() in (exit, Exit):
break
elif command.lower().split()[0] == 'get':
item = command.lower().split()[1]
if item in current_room['contents']:
current_room['contents'].remove(item)
inventory.append(item)
else:
print("I don't see that here.")
elif command.lower().split()[0] == 'drop':
item = command.lower().split()[1]
if item in inventory:
current_room['contents'].append(item)
invenotry.remove(item)
else:
print("You aren't carrying that.")
else:
print("I don't understand that command")