Add additional functionalites to this code. For one room add this riddle, "The shorter I am, the bigger I am. What am I?" And the only way to continue to the next room is to type, "A temper," or "temper." And for another room, a help command. For example, the user will type, "help," and they will be told where to go next so they can each the winning room.
Add additional functionalites to this code. For one room add this riddle, "The shorter I am, the bigger I am. What am I?" And the only way to continue to the next room is to type, "A temper," or "temper." And for another room, a help command. For example, the user will type, "help," and they will be told where to go next so they can each the winning room.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Add additional functionalites to this code. For one room add this riddle, "The shorter I am, the bigger I am. What am I?" And the only way to continue to the next room is to type, "A temper," or "temper." And for another room, a help command. For example, the user will type, "help," and they will be told where to go next so they can each the winning room.

Transcribed Image Text:def townSquare():
NE
print("You're in Town Square.")
print("Type 'Northeast' or
print("Type South' or 'S' to go
print("Type Southeast' or 'SE' to go to the Trading Post")
to go to the
to the Town Archives")
nextRoom =
#start copying here
while(nextRoom
userInput
nextRoom
if (userInput
nextRoom
else:
nextRoom =
elif (userInput
elif (userInput
nextRoom
else:
print("Command unrecognize.")
print(nextRoom)
while(nextRoom
userInput
if (userInput
else:
nextRoom =
else:
def tradingPost():
print("Welcome! You're in the Trading Post.")
print("You found a key.")
print("type 'Northwest' or 'NW' to go to Town Square.")
nextRoom
nextRoom =
print("Command unrecognize.")
while(nextRoom
userInput
if (userInput
nextRoom
else:
11 11
while(nextRoom
userInput
if (userInput
Game.")
def secretRoom():
print("Welcome! You're in the Secret Room.")
print("Go to the Study and type Pull Book.")
print("Type 'North' or 'N' to go to the Study.")
#start copying here
nextRoom
nextRoom
=
def endRoom():
else:
=
print("Command unrecognize.")
print(nextRoom)
def townArchives():
while(nextRoom
userInput
if (userInput
=
else:
""):
input("Player choice: ").upper()
== "NORTHEAST" or userInput
"Town Hall"
nextRoom =
TI
print("Welcome! You're in the Town Archives. ')
print("Type 'South' or 'S' to go to the Study.")
#start copying here
nextRoom
nextRoom
else:
"SOUTH" or userInput
"Town Archives"
11 11
print("Command unrecognize.")
nextRoom
"SOUTHEAST" or userInput
"Trading Post"
=
nextRoom
11 11
else:
def garden():
print("Welcome! You're in the Garden.")
print("Type 'West' or 'W' to go to the Dead End and return to the Car Ride or
Southeast' or 'SE' to return to the Town Square.")
nextRoom
#start_copying here
""):
"W"):
input("Player choice: ").upper()
== "WEST" or userInput
nextRoom = "Car Ride"
elif (userInput
print("Winner!")
print("Command unrecognize.")
print(nextRoom)
elif (userInput
nextRoom =
else:
=
while(nextRoom
userInput
if (userInput
=
nextRoom
"NORTHWEST" or userInput == "NW"):
"Town Square"
11 11
nextRoom
"Study"
=
nextRoom =
==
=
nextRoom
nextRoom
=
while(nextRoom
userInput
if (userInput
else:
def cultChambers():
print("Welcome! You're in the Cult Chambers.")
print("Type 'East' or 'E' to go to the Dead End or 'South' or 'S' to End
11 11
room
#start_copying here
""):
input("Player choice: ").upper()
"Study"
while(nextRoom
):
userInput input("Player choice: ").upper()
if (userInput == "EAST" or userInput == "E"):
print("Dead End")
print("Command unrecognize.")
print(nextRoom)
def underGroundCave():
==
=
main()
room
room
room
while(nextRoom
userInput
if (userInput
==
11 11
=
"Town Square"
==
print(nextRoom)
==
print("Command unrecognize.")
print(nextRoom)
):
input("Player choice: ").upper()
"NORTH" or userInput
==
==
print("Welcome! You're in the Under Ground Cave.
while(nextRoom
userInput
if (userInput
=
elif (room
print("Type 'South' or 'S' to go to the Cult Chambers.")
nextRoom =
#start copying here
==
11 11
=
""):
input("Player choice: ").upper()
"South" or userInput == "S"):
"End Room"
==
11 11
#start copying here
def study():
print("Welcome! You're in the Study.")
print("Type 'Pull Book' or 'PB' to go to the Underground Cave.")
nextRoom
#start_copying here
=
==
11 11
"Cult Chambers"
==
elif (userInput
"KEY" or userInput
nextRoom = "Secret Room"
nextRoom =
"Garden"
elif (userInput == "NORTH" or userInput
"Study"
==
print("Command unrecognize.")
print(nextRoom)
"Car Ride"
elif (userInput
=== "SOUTHEAST" or userInput
T
def mansion():
print("Welcome! You're in Mansion.")
print("Type 'West' or 'W'
to go to the Garden.")
print("Type 'North' or 'N'
to go to the Study.")
print("Type 'Key' or 'K' to enter the Secret Room.")
#start copying here
nextRoom =
==
==
==
def townHall():
print("Welcome! You're in the Town Hall.")
print("Type 'West' or 'W' to go
nextRoom
#start copying here
11 11
""):
input("Player choice: ").upper()
"SOUTH" or
userInput
""):
input("Player choice: ").upper()
== "PULL BOOK" or userInput == "PB"):
"Underground Cave"
print("Command unrecognize.")
print(nextRoom)
==
==
"SOUTH" or userInput
==
==
==
==
==
"Mansion"
==
""):
input("Player choice: ").upper()
"WEST" or userInput
"W"):
==
==
==
print("Command unrecognize.")
print(nextRoom)
'):
==
==
11 11
==
"Car Ride"):
carRide()
==
def carRide():
print("Type 'West' or 'W' to go to the Town Square else South/S, North/N, or
West/W for random location. .")
while(nextRoom
):
userInput = input("Player choice: ").upper()
if (userInput
"WEST" or userInput
"W"):
"Town Square"
"SOUTH"
"Trading Post"
elif (userInput == "NORTH" or userInput
nextRoom = "Garden"
elif (userInput == "WEST" or userInput
"Underground Cave"
==
room
elif (room
room =
tradingPost ()
elif (room == "Garden"):
room = garden()
elif (room == "Underground Cave"):
room =
underGroundCave()
elif (room == "Town Hall"):
room =
townHall()
elif (room
townSquare()
"Town Archives"):
townArchives()
elif (room == "Secret Room"):
room =
elif (room
room =
elif (room
room =
elif (room == "Study"):
study()
elif (room
input("Player choice: ").upper()
== "WEST" or userInput
"W"):
Town Hall")
"Town Square"):
secretRoom()
"NE"):
"S"):
==
==
"Trading Post"):
"N"):
"End Room")
==
endRoom ()
"Cult Chambers"):
cultChambers (
"Mansion"):
mansion()
===
or userInput
def main():
room =
"Car Ride"
print("You, re in a car. The town of Loveheaven
while (room != ""):
if (room
==
===
==
==
"S"):
"SE"):
"S"):
to the Mansion.")
===
"K"):
==
"SE"):
"N"):
11
"S"):
"W"):
"N"):
is
ahead. Can you escape?")
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 6 images

Knowledge Booster
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.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education