Saturday, October 29, 2016

Random Python Programs October 30 2016

Floyd Rectangle Test and Prototype 1

for counter in range(1,5,1):
print(counter,end=" ")
print("")
for counter in range(5,9,1):
print(counter,end=" ")
print("")
for counter in range(9,13,1):
print(counter,end=" ")
print("")
for counter in range(13,17,1):
print(counter,end=" ")
print("")

def rectangle1(length):
row = 1
start = row
stop = row+4
timer = length
rectangle2(start,stop,timer,row)
def rectangle2(start,stop,timer,row):
if timer>0:
for counter in range(start,stop,1):
print(counter,end=" ")
print("")
timer -= 1
row += 1
start = stop
stop += 4
rectangle2(start,stop,timer,row)
rectangle1(4)

Floyd Rectangle Test and Prototype 2

for counter in range(1,5,1):
print(counter,end=" ")
print("")
for counter in range(5,9,1):
print(counter,end=" ")
print("")
for counter in range(9,13,1):
print(counter,end=" ")
print("")
for counter in range(13,17,1):
print(counter,end=" ")
print("")

def rectangle1(length,width):
row = 1
start = row
stop = row+width
timer = length
rectangle2(start,stop,timer,row, width)
def rectangle2(start,stop,timer,row, width):
if timer>0:
for counter in range(start,stop,1):
print(counter,end=" ")
print("")
timer -= 1
row += 1
start = stop
stop += width
rectangle2(start,stop,timer,row, width)
rectangle1(2,5)


Floyd Rectangle Prototype 3

def rectangle1(length,width):
row = 1
start = row
stop = row+width
timer = length
rectangle2(start,stop,timer,row, width)
def rectangle2(start,stop,timer,row, width):
if timer>0:
for counter in range(start,stop,1):
print(counter,end=" ")
print("")
timer -= 1
row += 1
start = stop
stop += width
rectangle2(start,stop,timer,row, width)
else:
print("Program Complete")
runprogram()
def runprogram():
numbera=int(input("Type in the Length you Want For Your Floyd Rectangle: "))
numberb=int(input("Type in the Width you Want For Your Floyd Rectangle: "))
rectangle1(numbera,numberb)
runprogram()

World Builder Prototype 1

import random
def init():
print("[Initializing...]")
biomenumber = random.randint(1,4)
if biomenumber==1:
biome = "Winter Wonderland"
resource = "Freeze"
firstworld(biome,resource)
if biomenumber==2:
biome = "Sandy Plains"
resource = "Sand"
firstworld(biome,resource)
if biomenumber==3:
biome = "Rocky Mountains"
resource = "Stone"
firstworld(biome,resource)
if biomenumber==4:
biome = "Wet Waters"
resource = "Water"
firstworld(biome,resource)
def firstworld(biome,resource):
print("[Game Start]")
print("You are in the",biome,". You have access to",resource,". ")
if biome == "Winter Wonderland":
print(resource,"when combined with Water generates Ice.")
playground(biome,resource)
if biome == "Sandy Plains":
print(resource,"when combined with Water generates Mud.")
playground(biome,resource)
if biome == "Rocky Mountains":
print(resource,"can be used to Build Houses.")
playground(biome,resource)
if biome == "Wet Waters":
print(resource,"when combined with Water generates Ice.")
playground(biome,resource)
def playground(biome,resource):

init()

Walking in A Room Simulator Prototype 1

def walkworld(room): if room == 1: action = int(input("You are in room 1. You can go through door number one or door number two. Choose a door by typing in a number.: ")) if action == 1: room = 2 walkworld(room) if action == 2: room = 3 walkworld(room) if room == 2: action = int(input("You are in room 2. You can go through door number one or door number four. Choose a door by typing in a number.: ")) if action == 1: room = 1 walkworld(room) if action == 4: room = 4 walkworld(room) if room == 3: action = int(input("You are in room 3. You can go through door number two or door number three. Choose a door by typing in a number.: ")) if action == 2: room = 1 walkworld(room) if action == 3: room = 4 walkworld(room) if room == 4: action = int(input("You are in room 4. You can go through door number four or door number three. Choose a door by typing in a number.: ")) if action == 4: room = 2 walkworld(room) if action == 3: room = 3 walkworld(room) walkworld(1)


Walking in A Room Simulator Prototype 2

def walkworld(room): if room == 1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 1. You can go through door number one or door number two.: ") if action == "1": room = 2 walkworld(room) if action == "2": room = 3 walkworld(room) else: interact(room) if room == 2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 2. You can go through door number one or door number four.:") if action == "1": room = 1 walkworld(room) if action == "4": room = 4 walkworld(room) if room == 3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 3. You can go through door number two or door number three.: ") if action == "2": room = 1 walkworld(room) if action == "3": room = 4 walkworld(room) if room == 4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 4. You can go through door number four or door number three.: ") if action == "4": room = 2 walkworld(room) if action == "3": room = 3 walkworld(room) def interact(room): if room==1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") room1contents.remove(action) inventory.append(action) walkworld(room) if action == "place": action = input("What item would you like to place?: ") inventory.remove(action) room1contents.append(action) walkworld(room) if room==2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") room2contents.remove(action) inventory.append(action) walkworld(room) if action == "place": action = input("What item would you like to place?: ") inventory.remove(action) room2contents.append(action) walkworld(room) if room==3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) if action == "pick up": action = input("What item would you like to pick up?: ") room3contents.remove(action) inventory.append(action) walkworld(room) if action == "place": action = input("What item would you like to place?: ") inventory.remove(action) room3contents.append(action) walkworld(room) if room==4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) if action == "pick up": action = input("What item would you like to pick up?: ") room4contents.remove(action) inventory.append(action) walkworld(room) if action == "place": action = input("What item would you like to place?: ") inventory.remove(action) room4contents.append(action) walkworld(room) inventory = ["rock"] room1contents = [] room2contents = [] room3contents = [] room4contents = [] walkworld(1)

Walking in A Room Simulator Prototype 3

import random def walkworld(room): ghostlocation = random.randint(1,4) if ghostlocation == room: if "amulet" in inventory: print("-----------------------") print("The Ghost Has Found You") print("The Amulet Has Protected You From The Ghost's Wrath") else: print("-----------------------") print("The Ghost Has Found You") print("GAME OVER :( :( :(") exit() if room == 1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 1. You can go through door number one or door number two.: ") if action == "1": room = 2 walkworld(room) if action == "2": room = 3 walkworld(room) else: interact(room) if room == 2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 2. You can go through door number one or door number four.:") if action == "1": room = 1 walkworld(room) if action == "4": room = 4 walkworld(room) if room == 3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 3. You can go through door number two or door number three.: ") if action == "2": room = 1 walkworld(room) if action == "3": room = 4 walkworld(room) if room == 4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 4. You can go through door number four or door number three.: ") if action == "4": room = 2 walkworld(room) if action == "3": room = 3 walkworld(room) def interact(room): if room==1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") room1contents.remove(action) inventory.append(action) walkworld(room) if action == "place": action = input("What item would you like to place?: ") inventory.remove(action) room1contents.append(action) walkworld(room) if room==2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") room2contents.remove(action) inventory.append(action) walkworld(room) if action == "place": action = input("What item would you like to place?: ") inventory.remove(action) room2contents.append(action) walkworld(room) if room==3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) if action == "pick up": action = input("What item would you like to pick up?: ") room3contents.remove(action) inventory.append(action) walkworld(room) if action == "place": action = input("What item would you like to place?: ") inventory.remove(action) room3contents.append(action) walkworld(room) if room==4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) if action == "pick up": action = input("What item would you like to pick up?: ") room4contents.remove(action) inventory.append(action) walkworld(room) if action == "place": action = input("What item would you like to place?: ") inventory.remove(action) room4contents.append(action) walkworld(room) inventory = ["rock","amulet"] room1contents = [] room2contents = [] room3contents = [] room4contents = [] walkworld(1)

Walking in A Room Simulator Prototype 4

Error: Inventory Items Are Not Being Recognized


import random def walkworld(room): ghostlocation = random.randint(1,4) if ghostlocation == room: if "amulet" in inventory: print("-----------------------") print("The Ghost Has Found You") print("The Amulet Has Protected You From The Ghost's Wrath") else: print("-----------------------") print("The Ghost Has Found You") print("GAME OVER :( :( :(") exit() if room == 1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 1. You can go through door number one or door number two.: ") if action == "1": room = 2 walkworld(room) if action == "2": room = 3 walkworld(room) else: interact(room) if room == 2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 2. You can go through door number one or door number four.:") if action == "1": room = 1 walkworld(room) if action == "4": room = 4 walkworld(room) else: interact(room) if room == 3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 3. You can go through door number two or door number three.: ") if action == "2": room = 1 walkworld(room) if action == "3": room = 4 walkworld(room) else: interact(room) if room == 4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 4. You can go through door number four or door number three.: ") if action == "4": room = 2 walkworld(room) if action == "3": room = 3 walkworld(room) else: interact(room) def interact(room): if room==1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if action in room1contents: room1contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if action in room1contents: inventory.remove(action) room1contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) if room==2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if action in room2contents: room2contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if action in room2contents: inventory.remove(action) room2contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) if room==3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if action in room3contents: room3contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if action in room3contents: inventory.remove(action) room3contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) if room==4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if action in room4contents: room4contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if action in room4contents: inventory.remove(action) room4contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) inventory = ["rock","amulet"] room1contents = [] room2contents = [] room3contents = [] room4contents = [] walkworld(1)

Walking in A Room Simulator Prototype 5

import random def walkworld(room): ghostlocation = random.randint(1,4) if ghostlocation == room: if "amulet" in inventory: print("-----------------------") print("The Ghost Has Found You") print("The Amulet Has Protected You From The Ghost's Wrath") else: print("-----------------------") print("The Ghost Has Found You") print("GAME OVER :( :( :(") exit() if room == 1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 1. You can go through door number one or door number two.: ") if action == "1": room = 2 walkworld(room) if action == "2": room = 3 walkworld(room) if action == "interact": interact(room) if room == 2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 2. You can go through door number one or door number four.:") if action == "1": room = 1 walkworld(room) if action == "4": room = 4 walkworld(room) if action == "interact": interact(room) if room == 3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 3. You can go through door number two or door number three.: ") if action == "2": room = 1 walkworld(room) if action == "3": room = 4 walkworld(room) if action == "interact": interact(room) if room == 4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 4. You can go through door number four or door number three.: ") if action == "4": room = 2 walkworld(room) if action == "3": room = 3 walkworld(room) if action == "interact": interact(room) def interact(room): if room==1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room1contents: room1contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room1contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) if room==2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room2contents: room2contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room2contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) if room==3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room3contents: room3contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room3contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) if room==4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room4contents: room4contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room4contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) inventory = ["rock","amulet"] room1contents = [] room2contents = [] room3contents = [] room4contents = [] walkworld(1)

Walking in A Room Simulator Prototype 6

import random def walkworld(room): ghostlocation = random.randint(1,4) if ghostlocation == room: if "amulet" in inventory: print("-----------------------") print("The Ghost Has Found You") print("The Amulet Has Protected You From The Ghost's Wrath") else: print("-----------------------") print("The Ghost Has Found You") print("GAME OVER :( :( :(") exit() if room == 1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room","Type use to use an item in your inventory") action = input("You are in room 1. You can go through door number one or door number two.: ") if action == "1": room = 2 walkworld(room) if action == "2": room = 3 walkworld(room) if action == "interact": interact(room) if action == "use": use(room,ghostlocation) if room == 2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 2. You can go through door number one or door number four.:") if action == "1": room = 1 walkworld(room) if action == "4": room = 4 walkworld(room) if action == "interact": interact(room) if action == "use": use(room,ghostlocation) if room == 3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 3. You can go through door number two or door number three.: ") if action == "2": room = 1 walkworld(room) if action == "3": room = 4 walkworld(room) if action == "interact": interact(room) if action == "use": use(room,ghostlocation) if room == 4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 4. You can go through door number four or door number three.: ") if action == "4": room = 2 walkworld(room) if action == "3": room = 3 walkworld(room) if action == "interact": interact(room) if action == "use": use(room,ghostlocation) def interact(room): if room==1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room1contents: room1contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room1contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) if room==2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room2contents: room2contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room2contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) if room==3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room3contents: room3contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room3contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) if room==4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room4contents: room4contents.remove(action) inventory.append(action) walkworld(room) else: print(action,"is not an object within the room.") walkworld(room) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room4contents.append(action) walkworld(room) else: print(action,"is not an object within your inventory.") walkworld(room) def use(room,ghostlocation): print("-----------------------") print ("You currently have these items:", inventory) action = input("What item in your inventory would you like to use?: ") if action in inventory: if action == "rock": print("The rock has no particular use.") walkworld(room) if action == "amulet": if ghostlocation == room: print("The amulet's power is holding the ghost at bay.") else: print("The ghost can move anywhere so be careful. The ghost is currently in room",ghostlocation) else: print("This item is not in your inventory".) walkworld(room) inventory = ["rock","amulet"] room1contents = [] room2contents = [] room3contents = [] room4contents = [] walkworld(1)

Walking in A Room Simulator Prototype 7

import random def walkworld(room,health,magick): ghostlocation = random.randint(1,4) manalocation = random.randint(1,4) if manalocation == 1: room1contents.append("mana") if manalocation == 2: room2contents.append("mana") if manalocation == 3: room3contents.append("mana") if manalocation == 4: room4contents.append("mana") if ghostlocation == room: if "amulet" in inventory and magick>0: print("-----------------------") print("The Ghost Has Found You") print("The Amulet Has Protected You From The Ghost's Wrath") magick -= 1 if "amulet" in inventory and magick<1: -="1" amulet="" and="" attacked="" been="" by="" found="" ghost="" has="" have="" he="" health="" if="" in="" inventory="" not="" ou="" print="" the="" you="">0: print("-----------------------") print("The Ghost Has Found You") print("You have been attacked by the Ghost!") health -= 1 if "amulet" not in inventory and health<1: 1.="" 1:="" 1="" 2.="" 2:="" 3.="" 3:="" 4.="" 4:="" :="" a="" action="=" amulet="" an="" anywhere="" are="" at:="" at="" bay.="" be="" by="" can="" careful.="" consume="" contains:="" currently="" def="" door="" else:="" exit="" font="" found="" four.:="" four="" ghost="" ghostlocation="" go="" has="" hat="" have="" he="" health="" his="" holding="" hoose="" if="" in="" increase="" interact="" inventory.="" inventory.append="" inventory.remove="" inventory:="" inventory="[" is="" item="" items:="" like="" magick="" mana.="" mana="" move="" no="" not="" number.="" number="" o="" object="" one="" or="" ou="" our="" over="" particular="" pick="" place="" power="" powers="" print="" rock="" room.="" room1contents.append="" room1contents.remove="" room1contents:="" room1contents="[]" room2contents.append="" room2contents.remove="" room2contents:="" room2contents="[]" room3contents.append="" room3contents.remove="" room3contents:="" room3contents="[]" room4contents.append="" room4contents.remove="" room4contents:="" room4contents="[]" room:="" room="" s="" so="" str="" strengthening="" the="" these="" three.:="" through="" to="" two.:="" two="" typing="" up="" use.="" use="" walkworld="" want="" with="" within="" would="" you="" your="" ype="">

Walking in A Room Simulator Prototype 8

import random def walkworld(room,health,magick): ghostlocation = random.randint(1,4) manalocation = random.randint(1,4) if manalocation == 1: room1contents.append("mana") if manalocation == 2: room2contents.append("mana") if manalocation == 3: room3contents.append("mana") if manalocation == 4: room4contents.append("mana") if ghostlocation == room: if "amulet" in inventory and magick>0: print("-----------------------") print("The Ghost Has Found You") print("The Amulet Has Protected You From The Ghost's Wrath") magick -= 1 if "amulet" in inventory and magick<1: -="1" amulet="" and="" attacked="" been="" by="" found="" ghost="" has="" have="" he="" health="" if="" in="" inventory="" not="" ou="" print="" the="" you="">0: print("-----------------------") print("The Ghost Has Found You") print("You have been attacked by the Ghost!") health -= 1 if "amulet" not in inventory and health<1: 1.="" 1:="" 1="" 2.="" 2:="" 3.="" 3:="" 4.="" 4:="" :="" a="" action="" amulet="" an="" are="" at:="" by="" can="" consume="" contains:="" currently="" def="" door="" else:="" exit="" found="" four.:="" four="" ghost="" ghostlocation="" go="" has="" hat="" have="" he="" health="" hoose="" if="" in="" increase="" interact="" inventory.="" inventory.append="" inventory.remove="" inventory:="" inventory="" is="" item="" items:="" like="" magick="" mana.="" mana="" not="" number.="" number="" o="" object="" one="" or="" ou="" our="" over="" pick="" place="" powers="" print="" room.="" room1contents.append="" room1contents.remove="" room1contents:="" room1contents="" room2contents.append="" room2contents.remove="" room2contents:="" room2contents="" room3contents.append="" room3contents.remove="" room3contents:="" room3contents="" room4contents.append="" room4contents.remove="" room4contents:="" room4contents="" room="" str="" strengthening="" the="" these="" three.:="" through="" to="" two.:="" two="" typing="" up="" use="" walkworld="" want="" with="" within="" would="" you="" your="" ype="">5: print("You are overloaded with magick power! Increasing your magick, causes a decrease in your health!") health -= 1 walkworld(room,health,magick) else: walkworld(room,health,magick) if action == "rock": print("The rock has no particular use.") walkworld(room,health,magick) if action == "amulet": if ghostlocation == room: print("The amulet's power is holding the ghost at bay.") else: print("The ghost can move anywhere so be careful. The ghost is currently in room",ghostlocation) else: print("This item is not in your inventory.") walkworld(room,health,magick) inventory = ["rock","amulet"] room1contents = [] room2contents = [] room3contents = [] room4contents = [] walkworld(1,3,3)

Walking in A Room Simulator Prototype 9

import random def walkworld(room,health,magick): ghostlocation = random.randint(1,4) manalocation = random.randint(1,4) vampirelocation = random.randint(0,1) garliclocation = random.randint(0,1) if garliclocation == 1: room3contents.append(garlic) if vampirelocation == 1: if room == 2: if "garlic" in inventory: inventory.remove("garlic") vampirelocation = 0 print("-----------------------") print("You were attacked by a Vampire! Luckily you had garlic on you. The Vampire has consumed the garlic, and you are safe..for now.") if "garlic" not in inventory and health>0: print("-----------------------") print("You were attacked by a Vampire! Sadly you didn't get any cool powers..just a bad bruise." vampirelocation = 0 health -= 1 if "garlic" not in inventory and health=1: print("-----------------------") print("You were attacked by a Vampire!" print("You have died") print("GAME OVER") vampirelocation = 0 health -= 1 exit() if manalocation == 1: room1contents.append("mana") if manalocation == 2: room2contents.append("mana") if manalocation == 3: room3contents.append("mana") if manalocation == 4: room4contents.append("mana") if ghostlocation == room: if "amulet" in inventory and magick>0: print("-----------------------") print("The Ghost Has Found You") print("The Amulet Has Protected You From The Ghost's Wrath") magick -= 1 if "amulet" in inventory and magick<1: -="1" amulet="" and="" attacked="" been="" by="" found="" ghost="" has="" have="" he="" health="" if="" in="" inventory="" not="" ou="" print="" the="" you="">0: print("-----------------------") print("The Ghost Has Found You") print("You have been attacked by the Ghost!") health -= 1 if "amulet" not in inventory and health=1: print("-----------------------") print("The Ghost Has Found You") print("GAME OVER :( :( :(") exit() if room == 1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room","Type use to use an item in your inventory") action = input("You are in room 1. You can go through door number one or door number two.: ") if action == "1": room = 2 walkworld(room,health,magick) if action == "2": room = 3 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) if room == 2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 2. You can go through door number one or door number four.:") if action == "1": room = 1 walkworld(room,health,magick) if action == "4": room = 4 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) if room == 3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 3. You can go through door number two or door number three.: ") if action == "2": room = 1 walkworld(room,health,magick) if action == "3": room = 4 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) if room == 4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 4. You can go through door number four or door number three.: ") if action == "4": room = 2 walkworld(room,health,magick) if action == "3": room = 3 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) def interact(room,health,magick): if room==1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room1contents: room1contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room1contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) if room==2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room2contents: room2contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room2contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) if room==3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room3contents: room3contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room3contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) if room==4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room4contents: room4contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room4contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) def use(room,ghostlocation,health,magick): print("-----------------------") print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("What item in your inventory would you like to use?: ") if action in inventory: if action == "mana": print("You consume the mana. Your Magick powers increase, strengthening your amulet!") magick += 1 inventory.remove(action) if magick>5: print("You are overloaded with magick power! Increasing your magick, causes a decrease in your health!") health -= 1 walkworld(room,health,magick) else: walkworld(room,health,magick) if action == "garlic" print("You eat the garlic. Your breath kind of stinks. Its not healthy enough to heal you, and your breath doesn't stink enough to harm vampires") inventory.remove(garlic) walkworld(room,health,magick) if action == "rock": print("The rock has no particular use.") walkworld(room,health,magick) if action == "amulet": if ghostlocation == room: print("The amulet's power is holding the ghost at bay.") else: print("The ghost can move anywhere so be careful. The ghost is currently in room",ghostlocation) else: print("This item is not in your inventory.") walkworld(room,health,magick) inventory = ["rock","amulet"] room1contents = [] room2contents = [] room3contents = [] room4contents = [] walkworld(1,3,3)

Walking in A Room Simulator Prototype 10

import random def walkworld(room,health,magick): ghostlocation = random.randint(1,4) manalocation = random.randint(1,4) vampirelocation = random.randint(0,1) garliclocation = random.randint(0,1) if garliclocation == 1: room3contents.append("garlic") if vampirelocation == 1: if room == 2: if "garlic" in inventory: inventory.remove("garlic") vampirelocation = 0 print("-----------------------") print("You were attacked by a Vampire! Luckily you had garlic on you. The Vampire has consumed the garlic, and you are safe..for now.") if "garlic" not in inventory and health>0: print("-----------------------") print("You were attacked by a Vampire! Sadly you didn't get any cool powers..just a bad bruise.") vampirelocation = 0 health -= 1 if "garlic" not in inventory and 00: print("-----------------------") print("The Ghost Has Found You") print("The Amulet Has Protected You From The Ghost's Wrath") magick -= 1 if "amulet" in inventory and magick<1: -="1" amulet="" and="" attacked="" been="" by="" found="" ghost="" has="" have="" he="" health="" if="" in="" inventory="" not="" ou="" print="" the="" you="">0: print("-----------------------") print("The Ghost Has Found You") print("You have been attacked by the Ghost!") health -= 1 if "amulet" not in inventory and 2>health>0: print("-----------------------") print("The Ghost Has Found You") print("GAME OVER :( :( :(") exit() if room == 1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room","Type use to use an item in your inventory") action = input("You are in room 1. You can go through door number one or door number two.: ") if action == "1": room = 2 walkworld(room,health,magick) if action == "2": room = 3 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) if room == 2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 2. You can go through door number one or door number four.:") if action == "1": room = 1 walkworld(room,health,magick) if action == "4": room = 4 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) if room == 3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 3. You can go through door number two or door number three.: ") if action == "2": room = 1 walkworld(room,health,magick) if action == "3": room = 4 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) if room == 4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 4. You can go through door number four or door number three.: ") if action == "4": room = 2 walkworld(room,health,magick) if action == "3": room = 3 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) def interact(room,health,magick): if room==1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room1contents: room1contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room1contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) if room==2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room2contents: room2contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room2contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) if room==3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room3contents: room3contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room3contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) if room==4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room4contents: room4contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room4contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) def use(room,ghostlocation,health,magick): print("-----------------------") print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("What item in your inventory would you like to use?: ") if action in inventory: if action == "mana": print("You consume the mana. Your Magick powers increase, strengthening your amulet!") magick += 1 inventory.remove(action) if magick>5: print("You are overloaded with magick power! Increasing your magick, causes a decrease in your health!") health -= 1 walkworld(room,health,magick) else: walkworld(room,health,magick) if action == "garlic": print("You eat the garlic. Your breath kind of stinks. Its not healthy enough to heal you, and your breath doesn't stink enough to harm vampires") inventory.remove(garlic) walkworld(room,health,magick) if action == "rock": print("The rock has no particular use.") walkworld(room,health,magick) if action == "amulet": if ghostlocation == room: print("The amulet's power is holding the ghost at bay.") else: print("The ghost can move anywhere so be careful. The ghost is currently in room",ghostlocation) else: print("This item is not in your inventory.") walkworld(room,health,magick) inventory = ["rock","amulet"] room1contents = [] room2contents = [] room3contents = [] room4contents = [] walkworld(1,3,3)
<1: -="1" amulet="" and="" attacked="" been="" by="" found="" ghost="" has="" have="" he="" health="" if="" in="" inventory="" not="" ou="" print="" the="" you="">

Walking in A Room Simulator Prototype 11

import random def walkworld(room,health,magick): ghostlocation = random.randint(1,4) manalocation = random.randint(1,4) vampirelocation = random.randint(0,1) garliclocation = random.randint(0,1) if garliclocation == 1: room3contents.append("garlic") if vampirelocation == 1: if room == 2: if "garlic" not in inventory and 00: print("-----------------------") print("You were attacked by a Vampire! Sadly you didn't get any cool powers..just a bad bruise.") vampirelocation = 0 health -= 1 if "garlic" in inventory: inventory.remove("garlic") vampirelocation = 0 print("-----------------------") print("You were attacked by a Vampire! Luckily you had garlic on you. The Vampire has consumed the garlic, and you are safe..for now.") if manalocation == 1: room1contents.append("mana") if manalocation == 2: room2contents.append("mana") if manalocation == 3: room3contents.append("mana") if manalocation == 4: room4contents.append("mana") if ghostlocation == room: if "amulet" not in inventory and 2>health>0: print("-----------------------") print("The Ghost Has Found You") print("GAME OVER :( :( :(") exit() if "amulet" not in inventory and health>0: print("-----------------------") print("The Ghost Has Found You") print("You have been attacked by the Ghost!") health -= 1 if "amulet" in inventory and magick<1: -="1" amulet="" and="" attacked="" been="" by="" found="" ghost="" has="" have="" he="" health="" if="" in="" inventory="" magick="" ou="" print="" the="" you="">0: print("-----------------------") print("The Ghost Has Found You") print("The Amulet Has Protected You From The Ghost's Wrath") magick -= 1 if room == 1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room","Type use to use an item in your inventory") action = input("You are in room 1. You can go through door number one or door number two.: ") if action == "1": room = 2 walkworld(room,health,magick) if action == "2": room = 3 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) if room == 2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 2. You can go through door number one or door number four.:") if action == "1": room = 1 walkworld(room,health,magick) if action == "4": room = 4 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) if room == 3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 3. You can go through door number two or door number three.: ") if action == "2": room = 1 walkworld(room,health,magick) if action == "3": room = 4 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) if room == 4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) print ("Choose a door by typing in a number.","Type interact to interact with the room") action = input("You are in room 4. You can go through door number four or door number three.: ") if action == "4": room = 2 walkworld(room,health,magick) if action == "3": room = 3 walkworld(room,health,magick) if action == "interact": interact(room,health,magick) if action == "use": use(room,ghostlocation,health,magick) def interact(room,health,magick): if room==1: print("-----------------------") print ("The room you are in contains:", room1contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room1contents: room1contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room1contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) if room==2: print("-----------------------") print ("The room you are in contains:", room2contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room2contents: room2contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room2contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) if room==3: print("-----------------------") print ("The room you are in contains:", room3contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room3contents: room3contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room3contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) if room==4: print("-----------------------") print ("The room you are in contains:", room4contents) print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("Do you want to pick up or place an item?: ") if action == "pick up": action = input("What item would you like to pick up?: ") if (str(action)) in room4contents: room4contents.remove(action) inventory.append(action) walkworld(room,health,magick) else: print(action,"is not an object within the room.") walkworld(room,health,magick) if action == "place": action = input("What item would you like to place?: ") if (str(action)) in inventory: inventory.remove(action) room4contents.append(action) walkworld(room,health,magick) else: print(action,"is not an object within your inventory.") walkworld(room,health,magick) def use(room,ghostlocation,health,magick): print("-----------------------") print ("You currently have these items:", inventory) print ("Your health is currently at:",health) print ("Your magick is currently at:",magick) action = input("What item in your inventory would you like to use?: ") if action in inventory: if action == "mana": print("You consume the mana. Your Magick powers increase, strengthening your amulet!") magick += 1 inventory.remove(action) if magick>5: print("You are overloaded with magick power! Increasing your magick, causes a decrease in your health!") health -= 1 walkworld(room,health,magick) else: walkworld(room,health,magick) if action == "garlic": print("You eat the garlic. Your breath kind of stinks. Its not healthy enough to heal you, and your breath doesn't stink enough to harm vampires") inventory.remove("garlic") walkworld(room,health,magick) if action == "rock": print("The rock has no particular use.") walkworld(room,health,magick) if action == "amulet": if ghostlocation == room: print("The amulet's power is holding the ghost at bay.") else: print("The ghost can move anywhere so be careful. The ghost is currently in room",ghostlocation) else: print("This item is not in your inventory.") walkworld(room,health,magick) inventory = ["rock","amulet"] room1contents = [] room2contents = [] room3contents = [] room4contents = [] walkworld(1,3,3)

No comments:

Post a Comment