QuestionQuestion

Please see Question.pdf

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

# silver lock state variable
silver_lock = "left"
# gold lock state variable
gold_lock = "center"
# soil state variable
soil = "dry"
# string state variable
string = "floor"
# tomcat state variable
tomcat = "bedroom"
# mouse state variable
mouse = "hidden"
# carrying state variable
carrying = []

# Function to go to Entrance
def goEntrance():
    global silver_lock, gold_lock
    # Print room
    print("\n\n")
    print("Room: Entrance")
    print("--------------")
    print("")
    # Print Entrance description
    print("You're in the entrance hallway. The door that brought you in from the outside is gone.")
    print()
    print("In front of you there is a door that leads deeper into the house. To your left is an entranceway into the pantry. To your right is an entranceway into the kitchen.")
    print()
    print("Room actions")
    print("1: Try to open the door")
    print("2: Go through the left entryway")
    print("3: Go through the right entryway")
    # Get user input
    choice = input("Your selection: ")
    # Handle Entrance action
    if choice == "1":
       if silver_lock == "right" and gold_lock == "left":
            return goLivingRoom()
       else:
            print("The door remains stubbornly locked!")
    elif choice == "2":
       return goPantry()
    elif choice == "3":
       return goKitchen()
    else:
       print("ERROR: "+choice+" is not a valid selection, select one of: 1,2,3")
    goEntrance()

# Function to go to Pantry
def goPantry():
    global silver_lock
    # Print room
    print("\n\n")
    print("Room: Pantry")
    print("--------------")
    print("")
    # Print Pantry description
    print("You're in the pantry that contains the usual foodstuffs. In front of you is a silver lock with 3 positions: left, center and right. Behind you is the doorway to the entranceway.")
    print()...
$50.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Python Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats