Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.
image text in transcribed
IH dictionary for the simplified dragon text game \#The dictionary links a roon to other rooms. def main(): rooms ={ 'Great Hal2': { 'South': 'Bedroom' }, 'Bedroom': \{'North': 'Great Hal2', 'East': 'Cellar'\}, 'Cellar': \{'West': 'Bedroom'\} \} HPlailable movements movement comands =[ 'go North', 'go South', 'go East', 'go llest', 'exit' ] \#starting location current_room = 'Great HaLl' \#ame 2000 ;while True: \#Display current roon print("You are in \{\} ". format(courrent_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[cormand ]] print("Hoving to:" [current_room[comnand]]) \#Invalid nove otse: print("Invalid move")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions