logo Hurry, Grab up to 30% discount on the entire course
Order Now logo
602 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Doyle TaftEducation
(5/5)

809 Answers

Hire Me
expert
Rech ElleeNursing
(5/5)

767 Answers

Hire Me
expert
Marilyn HowardMarketing
(5/5)

820 Answers

Hire Me
expert
Faikandine Roger BANIENOthers
(/5)

510 Answers

Hire Me
Python Programming
(5/5)

You look around the woods and see a path cleared by trees and a cave. Will you take the path or go into the cave?

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

 

import time

inventory = []

yes = ["Yes", "Y", "yes", "y"]

 

def forest():

  print("You look around the woods and see a path cleared by trees and a cave. Will you take the path  or go into the cave? ")

  choice = input("Press 1 to go to the path or press 2 to go to the cave. Choose 1 or 2 > ")

  if choice == "1":

   path()

  elif choice == "2":

   cave()

  else: 

    print("I didn't understand that, please pick A, B or C")

    forest()

 

def inventoryitem1():

  if "sword" in inventory:

    print("You see nothing new of interest")

    cave()

  else:

    print("You see a sword, do you take it?")

    choice = input("Yes or no > ?")

    if choice in yes: 

     print("You take the sword.")

     inventory.append("sword")

     cave()

    else:

      print("Fine. Your loss!")

      cave() 

 

def cave():

   print("You find yourself in a cave.")

   print("Do you \nA. leave the cave and go to the path or \nB. go further into the cave or \nC. look around the cave.")

   choice = input("Choose A, B, or C")

   if choice == "A":

    path()

   elif choice == "B":

    deepincave()

   elif choice == "C":

    inventoryitem1()

    cave()

   else: 

    print("I don't understand that. You can type A, B, or C.")

    cave()

 

 

 

def deepincave():

   print("You have moved further into the cave.")

   choice = input("Do you A, go back to the cave entrance or B, look around")

   if choice == "A":

    cave()

   elif choice == "B":

    if "sword" in inventory:

     print("You find a flashlight and pick it up. ")

    win() 

   else: 

    print("I don't understand that. You can type A or B.")

deepincave()

 

 

def path():

   print("You go down the path and see an opening into another cave and you also see your trail is a dead end.")

   choice = input("Do you \nA. Go back to where you woke up or \nB. look around or \nC. go into the cave opening")

   if choice == "A":

    forest()

   elif choice == "B":

      print("You find nothing new of interest.")

      path()

   elif choice == "C":

     cave()

   else: 

      print("I don't understand that. You can type A or B or C.")

      path()

 

def win():

  print("You used the sword and flashlight to protect yourself while finding your way out of the woods. You saw bright lights...")

  time.sleep(1)

  print("You followed the bright lights and once again found ciziliaztion. You have won the game!")

   print("Welcome to my game")

name = input ("What is your name?")

print("Hello " + name + " the purpose of this game is to escape the house!! Good luck.. ")

forest() 8:00 EST tomorrow morning! Can you help?

 

(5/5)
Attachments:

Expert's Answer

602 Times Downloaded

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme