
Concept explainers
Create the logic for command processing (parsing) for each room. Use a if/elif/else structure to parse the command entered. Only handle the movement directions.
For each room, after the input statement, parse the input and simply print out the result. Need to handle all the cardinal directions (North, South, East, West, Northeast, Northwest, Southeast, Southwest) and Up and Down for each room. The user needs to be able to either spell out the direction or use a standard abbreviation. For example, North and N both represent the north. If the user enters a valid direction that isn't an obvious exit print out a message, such as "You can't go that way." or "You run into a wall. Ouch!". If they pick a direction, they can go just print out "You go the direction."
Have this be for each rooms for all the obvious exits.
....
Here is the code that needs working with:
def mazeEntrance():
print("You're in Maze Entrance.")
print("Type 'Northeast' to go to Red Room")
print("Type 'South' to go to the Blue Room")
print("type 'Southeast' to go to the Green Room")
userInput = input("Player choice: ")
if userInput =="Northeast":
redRoom()
elif userInput =="South":
blueRoom()
elif userInput =="Southeast":
greenRoom()
def greenRoom():
print("Welcome! You're in the Green Room,")
print("You found a code.")
print(" type 'Northwest' to go to Purple Room.")
userInput = input("Player choice: ")
if userInput =="Northwest":
mazeEntrance()
def goldRoom():
print("Welcome! You're in the Gold Room.")
print("Go to the White Room and type 1234.")
print("type 'North' to go to the White Room.")
userInput = input("Player choice: ")
if userInput =="North":
whiteRoom()
def blueRoom():
print("Welcome! You're in the Blue Room.")
print("type 'South to go to White Room.")
userInput = input("Player choice: ")
if userInput =="South":
whiteRoom()
def cyanRoom():
print("Welcome! You're in the Cyan Room,")
print("type 'West' to go to the Dead End and return to Purple Room or Southeast to return to Maze Entrance")
userInput = input("Player choice: ")
if userInput =="West":
startPoint()
elif userInput =="Southeast":
mazeEntrance()
def endRoom():
print("Winner!")
def blackRoom():
print("Welcome! You're in the Black Room,")
print("type 'East' or 'South'")
userInput = input("Player choice: ")
if userInput =="East":
print("Dead End")
elif userInput =="South":
endRoom()
def violetRoom():
print("Welcome! You're in the Violet Room,")
print("type 'South' to go to the Black Room")
userInput = input("Player choice: ")
if userInput =="South":
blackRoom()
def whiteRoom():
print("Welcome! You're in the White Room,")
print("type '1234' to go to the Violet Room")
userInput = input("Player choice: ")
if userInput =="1234":
violetRoom()
else:
startPoint()
def chromaticRoom():
print("Welcome! You're in Chromatic Room,")
print("type 'West' to go to the Cyan Room")
print("type 'North' to go to the White Room")
print("type 'Code' to enter the Gold Room.")
userInput = input("Player choice: ")
if userInput =="West":
cyanRoom()
elif userInput =="North":
whiteRoom()
elif userInput =="Code":
goldRoom()
def redRoom():
print("Welcome! You're in the Red Room,")
print("type 'West' to go to the Chromatic Room.")
userInput = input("Player choice: ")
if userInput =="West":
chromaticRoom()
print("The Scary Maze is ahead. Can you escape?")
def startPoint():
print("Type 'West' to go to Maze Entrance")
userInput = input("Player choice:")
if userInput =="West":
mazeEntrance()
startPoint()

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 4 images

- The intended purpose of the following module is to determine whether the value parameter is within a specified range. The module will not work, however. Find the problem.arrow_forwardGiven the following statement: boolean exp = ((!( bool1 && bool2 ) ) || ( ! bool3 ) ); Retype it in the input textbox below and remove as many parenthesis as possible without changing how the expression is evaluated. Without changing how the expression is evaluated means that the operators are evaluated in the same order in your answer and the original expression.arrow_forwardJump to level1 Write multiple if statements: If car_year is before 1967, print "Probably has few safety features." (without quotes). If after 1970, print "Probably has seat belts.". If after 1991, print "Probably has anti-lock brakes.". If after 2000, print "Probably has airbags.". End each phrase with period and newline. Remember that print() automatically adds a newline. Ex: car_year = 1995 prints: Probably has seat belts. Probably has anti-lock brakes. 1 car_year = int(input()) 3 Your code goes here " 4arrow_forward
- use the RUSTarrow_forwardStarting from the DFA shown below, use the construction DFA to Regular Expression to find a regular expression that describes the same language as is recognized by the DFA a) Draw the initial GNFA (with new start and accept states etc) then the GNFA obtained after ripping each state until just q start and q accept are left. If you did everything correctly, your label for the last remaining arrow should be the answer. 9₁ q= 2 b) Give a simple English description of the language for the DFA in Parta. That means a sentence in the style of "All strings that have at least two 1's and end with a 10arrow_forwardYou are tasked with writing a C++ program that helps analyze a student's performance over a semester. The program should gather input regarding the student's grades in 5 subjects and then provide information about the overall performance. Here are the specific program details: • The program should request the user to input grades for 5 subjects (assume a scale of 0 to 100). ● Calculate the average grade for the semester. Display the average grade to the user. Provide a performance category based on the following criteria: - Below 40: Fail ● ● - 40 to 59: Average - 60 to 79: Good - 80 to 89: Very Good - 90 to 100: Excellent • Additionally, if any subject's grade is below 40, display a message recommending additional attention to that subject. Please write a C++ program following the specified requirements and make sure to include comments for clarity and self-documentation.arrow_forward
- I'm asking for help with different perspectives on purpose. Also, you do not have to complete the code, I’m posting the entire question in order for the question to be clear. Sorry if you see this question ask more than once. Objectives: The main objective of this assignment is to assess the student’s ability to provide a complete Black-Box testing plan for a computer program. Description: you will need to design a complete Black-Box testing plan for the following program. Instead of changing passwords every semester, students will now change passwords once a month. Unfortunately, the school has realized that many students are bad at picking their passwords. Ideally, passwords alternate between letters, numbers, and symbols. However, most students and faculty pick passwords such as “12345password”. To make matters worse, when students and faculty are forced to change their password, usually only a single character is added to the end of their previous password. Due to this…arrow_forwardhelparrow_forwardi am trying to write code for c#. the gui is set up. i have 3 list boxes each with 3 items and each item has a different price. customer should select one from each list box and then be presented with a total price. i'm struggling to know what is the first thing i do. i have the using information, namespace......do i begin after Initialize Component?arrow_forward
- It is not sufficient to declare a variable using the word "type" alone. Identifiers may be derived from a variable's data type as well as other aspects of its makeup. The next thing that has to be done is to find out how to characterise any given variable by employing this concept.arrow_forwardUpdate the validateForm() function to verify the phone number is exactly 10 characters long. Display "Phone number is invalid" in the console log if the phone number does not meet the requirements. Use the preventDefault() function to avoid submitting the form when the input is invalid.arrow_forwardSlappy’s Software Sales AssignmentYou have been hired by Slappy’s Software Sales to write a program to figure thetotal cost to customers that order Slappy’s software packages.Discounts are given based on the number of units sold:Number of Units Sold Discount Amount1 – 9 None10 – 19 20%20 – 49 30%50 – 99 40%100 or more 50%Create a form similar to this:The three boxes are labels. Remember to use the Auto Size and Border Styleproperties.The program should read the number of units sold and figure a base cost. Theunits cost $99 each. A discount should then be figured and subtracted from thebase cost. The subtotal, discount amount and total cost should be displayed, ascurrency, in the appropriate labels.Here are some screen shots of the running program:Set the tab order and access keys.Put comments in your program as to what each section is doing.Use constants for the discount rates and base price.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





