Moving Between Rooms - Navigation In this assignment, you will be working with a given "rooms" dictionary and associated constants to create a simple text-based game. Your main task is to develop a function that allows the player to navigate through the rooms based on the given specifications. You need to implement the function found in the starter code to the right The function should take into account the following conditions: If the direction leads to an exit, set the next room to the exit and the message to "Goodbye". If the direction is invalid, set the next room to the current room and the message to "No such direction". If the direction is valid, but you cannot go that way, set the next room to the current room and the message to "You bumped into a wall". If the direction is valid and you can go that way, set the next room to the room in that direction and the message to "Empty". To help you understand how the function will be integrated into the gameplay loop, the following sample code is provided: result = navigate(current_room, direction) if result[1] != "": print(result[1]) current_room = result[0]

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Moving Between Rooms - Navigation In this assignment, you will be working with a given "rooms" dictionary and associated constants to create a simple text-based game. Your main task is to develop a function that allows the player to navigate through the rooms based on the given specifications. You need to implement the function found in the starter code to the right The function should take into account the following conditions: If the direction leads to an exit, set the next room to the exit and the message to "Goodbye". If the direction is invalid, set the next room to the current room and the message to "No such direction". If the direction is valid, but you cannot go that way, set the next room to the current room and the message to "You bumped into a wall". If the direction is valid and you can go that way, set the next room to the room in that direction and the message to "Empty". To help you understand how the function will be integrated into the gameplay loop, the following sample code is provided: result = navigate(current_room, direction) if result[1] != "": print(result[1]) current_room = result[0]
## Module Six Assignment

### Overview

In this assignment, 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.

### Graphical Layout of Rooms:

The layout features three rooms and their respective connections as shown in the diagram:

```
        Great Hall
          |
         North
          |
        Bedroom ---- West <-> East ---- Cellar
```

- **Great Hall** is north of the Bedroom.
- **Bedroom** is in the center, connected to the Great Hall to the north and the Cellar to the east.
- **Cellar** is east of the Bedroom.

### Detailed Requirements:

#### Gameplay Loop

Your task is to develop a gameplay loop with the following functionalities:

1. **Room Display:**
   - Output that displays the room the player is currently in.

2. **Decision Branching for Commands:**
   - **Move Commands:**
     - Commands can be to move in a certain direction (North, South, East, or West).
     - If the player enters a valid "move" command, the game should use the dictionary to move them into the new room.
   - **Exit Command:**
     - If the player enters "exit," the game should set their room to a room called "exit."
   - **Invalid Command Handling:**
     - If the player enters an invalid command, the game should output an error message to the player (input validation).

3. **End Gameplay Loop:**
   - A way to end the gameplay loop once the player is in the "exit" room.

**TIP:** Use the pseudocode or flowchart that you designed in Step 4 of Project One to help you develop your code.

#### Debugging and Testing

As you develop the code, you should **debug** your code to minimize errors and enhance functionality. Ensure the code runs correctly by considering the following:
   - What happens if the player enters a valid direction? Does the game move them to the correct room?
   - What happens if the player enters an invalid direction? Does the game provide the correct output?
   - Can the player exit the game?

### Guidelines for Submission

Submit your `ModuleSixAssignment.py` file. Be sure to include your name in a comment at the top of the code file.
Transcribed Image Text:## Module Six Assignment ### Overview In this assignment, 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. ### Graphical Layout of Rooms: The layout features three rooms and their respective connections as shown in the diagram: ``` Great Hall | North | Bedroom ---- West <-> East ---- Cellar ``` - **Great Hall** is north of the Bedroom. - **Bedroom** is in the center, connected to the Great Hall to the north and the Cellar to the east. - **Cellar** is east of the Bedroom. ### Detailed Requirements: #### Gameplay Loop Your task is to develop a gameplay loop with the following functionalities: 1. **Room Display:** - Output that displays the room the player is currently in. 2. **Decision Branching for Commands:** - **Move Commands:** - Commands can be to move in a certain direction (North, South, East, or West). - If the player enters a valid "move" command, the game should use the dictionary to move them into the new room. - **Exit Command:** - If the player enters "exit," the game should set their room to a room called "exit." - **Invalid Command Handling:** - If the player enters an invalid command, the game should output an error message to the player (input validation). 3. **End Gameplay Loop:** - A way to end the gameplay loop once the player is in the "exit" room. **TIP:** Use the pseudocode or flowchart that you designed in Step 4 of Project One to help you develop your code. #### Debugging and Testing As you develop the code, you should **debug** your code to minimize errors and enhance functionality. Ensure the code runs correctly by considering the following: - What happens if the player enters a valid direction? Does the game move them to the correct room? - What happens if the player enters an invalid direction? Does the game provide the correct output? - Can the player exit the game? ### Guidelines for Submission Submit your `ModuleSixAssignment.py` file. Be sure to include your name in a comment at the top of the code file.
### Overview

As you are preparing for your final text game project submission, the use of dictionaries, decision branching, and loops will be an important part of your solution. This milestone will help guide you through the steps of moving from your pseudocode or flowchart to code within the PyCharm integrated development environment (IDE).

You will be working with the same text-based game scenario from Projects One and Two. In this milestone, you will develop code for a simplified version of the sample dragon-themed game. The simplified version involves moving between a few rooms and being able to exit the game with an "exit" command. In the simplified version, there are no items, inventory, or villain. Developing this simplified version of the game supports an important programming strategy: working on code in small iterations at a time. Completing this milestone will give you a head start on your work to complete the game for Project Two.

### Prompt

For this milestone, you will be submitting a working draft of the code for a simplified version of the text-based game that you are developing for Project Two. 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.

1. Before beginning this milestone, it is important to understand the required functionality for this simplified version of the game. The game should prompt the player to enter commands to either move between rooms or exit the game. Review the [Milestone Simplified Dragon Text Game Video](#) and the [Milestone Simplified Text Game Flowchart](#) to see an example of the simplified version of the game. A video transcript is available [here](#).

   **IMPORTANT:** The "Move Between Rooms" process in the Milestone Simplified Text Game Flowchart is intentionally vague. You designed a more detailed flowchart or pseudocode for this process as part of your work on Project One. Think about how your design will fit into this larger flowchart.

2. In PyCharm, create a new code file titled “ModuleSixMilestone.py”. At the top of the file, include a comment with your name. As you develop your code, you must use industry-standard best practices, including in-line comments and appropriate naming conventions, to enhance the readability and maintainability of the code.

3. Next, copy the following dictionary into your .PY file. This dictionary links rooms to one another and will be used to store
Transcribed Image Text:### Overview As you are preparing for your final text game project submission, the use of dictionaries, decision branching, and loops will be an important part of your solution. This milestone will help guide you through the steps of moving from your pseudocode or flowchart to code within the PyCharm integrated development environment (IDE). You will be working with the same text-based game scenario from Projects One and Two. In this milestone, you will develop code for a simplified version of the sample dragon-themed game. The simplified version involves moving between a few rooms and being able to exit the game with an "exit" command. In the simplified version, there are no items, inventory, or villain. Developing this simplified version of the game supports an important programming strategy: working on code in small iterations at a time. Completing this milestone will give you a head start on your work to complete the game for Project Two. ### Prompt For this milestone, you will be submitting a working draft of the code for a simplified version of the text-based game that you are developing for Project Two. 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. 1. Before beginning this milestone, it is important to understand the required functionality for this simplified version of the game. The game should prompt the player to enter commands to either move between rooms or exit the game. Review the [Milestone Simplified Dragon Text Game Video](#) and the [Milestone Simplified Text Game Flowchart](#) to see an example of the simplified version of the game. A video transcript is available [here](#). **IMPORTANT:** The "Move Between Rooms" process in the Milestone Simplified Text Game Flowchart is intentionally vague. You designed a more detailed flowchart or pseudocode for this process as part of your work on Project One. Think about how your design will fit into this larger flowchart. 2. In PyCharm, create a new code file titled “ModuleSixMilestone.py”. At the top of the file, include a comment with your name. As you develop your code, you must use industry-standard best practices, including in-line comments and appropriate naming conventions, to enhance the readability and maintainability of the code. 3. Next, copy the following dictionary into your .PY file. This dictionary links rooms to one another and will be used to store
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY