subject

Def player_stats(): print('Inventory: []')
print('')
print("Enter your move:\n")

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']))< br /> print(current_room['text'])
command = input('What do you do?\n').strip()
if current_room['contents']:
print("In the room are: {}.".format(', '.join(current_room['contents'])))< br /> 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(ite m)
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(ite m)
invenotry. remove(item)
else:
print("You aren't carrying that.")
else:
print("I don't understand that command")

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
What must you do before formatting a paragraph?
Answers: 1
question
Computers and Technology, 22.06.2019 23:00
Is an attack that relies on guessing the isns of tcp packets
Answers: 2
question
Computers and Technology, 23.06.2019 01:30
In deadlock avoidance using banker’s algorithm, what would be the consequence(s) of: (i) a process declaring its maximum need as maximum possible for each resource. in other words, if a resource a has 5 instances, then each process declares its maximum need as 5. (ii) a process declaring its minimum needs as maximum needs. for example, a process may need 2-5 instances of resource a. but it declares its maximum need as 2.
Answers: 3
question
Computers and Technology, 23.06.2019 02:30
How to launch an app: steps to be successful? launching an app is a great idea, but it’s not that easy as we supposed to think. the majority of mobile applications don’t generate revenue because companies aren’t ready to be competitive. referring to our experience in successfully building and launching apps we hope to you omit these difficulties. we are going to talk about ideas, marketing, testing your product, its development, distribution and support. you will learn 8 product launch stages to succeed.
Answers: 1
You know the right answer?
Def player_stats(): print('Inventory: []')
print('')
print("Enter your move:\n")
<...
Questions
question
Mathematics, 16.04.2021 17:00
question
Chemistry, 16.04.2021 17:00
question
Mathematics, 16.04.2021 17:00
Questions on the website: 13722366