#Written by Oleksiy Al-saadi import random import time import os hp = 100 bag = [] os.system("clear") def Field(hp, bag): while 1 == 1: command = input("Type 'Door' or 'Tree': ") if (command == "Tree"): bag.append("Key") print("You found a key in the trunk of the tree! But you scratch your arm, -10 HP") hp = hp - 10 elif (command == "Door"): if ("Key" in bag): print("You open the door with the key.") bag.remove("Key") break else: print("You don't have a key.") else: print("Not a valid command.") print("You leave the field.") return hp, bag print("You wake up in a field in Omaha (uh oh). You see a shack with a door, and a tree.") hp, bag = Field(hp, bag) print("Current HP is " + str(hp))