Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for a simplified version of a text-based game. You will focus on displaying how a room dictionary works with the move commands. This

This is for a simplified version of a text-based game. You will focus on displaying how a room dictionary works with the move commands. This will include the if, else, and elif statements that move the adventurer from one room to another.

First, use this dictionary and map to help guide you in your game (map attached):

#A dictionary for the simplified dragon text game #The dictionary links a room to other rooms. rooms = { 'Great Hall': {'South': 'Bedroom'}, 'Bedroom': {'North': 'Great Hall', 'East': 'Cellar'}, 'Cellar': {'West': 'Bedroom'} }

image text in transcribed

Next, you will develop code to meet the required functionality, by prompting the player to enter commands to move between the rooms or exit the game. To achieve this, you must develop the following:

  • A gameplay loop that includes:
    • Output that displays the room the player is currently in
    • Decision branching that tells the game how to handle the different commands. The commands can be to either move between rooms (such as go North, South, East, or West) or exit.
      • If the player enters a valid move command, the game should use the dictionary to move them into the new room.
      • If the player enters exit, the game should set their room to a room called exit.
      • If the player enters an invalid command, the game should output an error message to the player (input validation).
    • A way to end the gameplay loop once the player is in the exit room.
Great Hall North South East Bedroom Cellar West

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

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

2. Identify the employees who are included in the plan.

Answered: 1 week ago

Question

7. Discuss the implications of a skill-based pay plan for training.

Answered: 1 week ago