I have no clue where to go from here. If I enter one of the movement commands it still gives me "Invalid move" Someone please show me what I'm missing. This assignment is already late.

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter8: Arrays
Section: Chapter Questions
Problem 12E
icon
Related questions
Question

I have no clue where to go from here. If I enter one of the movement commands it still gives me "Invalid move"

Someone please show me what I'm missing. This assignment is already late.
   
2
3
4
5
6
7
8
29
30
51
52
#A dictionary for the simplified dragon text game
#The dictionary links a room to other rooms.
Edef main():
O
O
}
#vailable movements
movement commands = ['go North', 'go South', 'go East', 'go West', 'exit']
#starting location
current_room= 'Great Hall'
6
rooms = :{
#game Loop
while True:
A
'Great Hall': {'South': 'Bedroom"},
'Bedroom': {'North': 'Great Hall', 'East': 'Cellar'},
'Cellar': {'West': 'Bedroom'}
O
#Display current room
print("You are in ()". format (current_room))
command=input("Enter movement or exit: ")
print (command)
#User command exit
if command == "exit":
current_room= "exit"
print("Goodbye")
break
#User command movement
elif command in movement_commands:
current_room = rooms [current_room [command]]
print("Moving to:" [current_room [command]])
#Invalid move
else:
print("Invalid move")
I
Transcribed Image Text:2 3 4 5 6 7 8 29 30 51 52 #A dictionary for the simplified dragon text game #The dictionary links a room to other rooms. Edef main(): O O } #vailable movements movement commands = ['go North', 'go South', 'go East', 'go West', 'exit'] #starting location current_room= 'Great Hall' 6 rooms = :{ #game Loop while True: A 'Great Hall': {'South': 'Bedroom"}, 'Bedroom': {'North': 'Great Hall', 'East': 'Cellar'}, 'Cellar': {'West': 'Bedroom'} O #Display current room print("You are in ()". format (current_room)) command=input("Enter movement or exit: ") print (command) #User command exit if command == "exit": current_room= "exit" print("Goodbye") break #User command movement elif command in movement_commands: current_room = rooms [current_room [command]] print("Moving to:" [current_room [command]]) #Invalid move else: print("Invalid move") I
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Multiple table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,