Import Random
Essay by people • December 15, 2011 • Study Guide • 833 Words (4 Pages) • 1,255 Views
print("Welcome to the terrifying Dungeon!",
"nYou may be killed if you continue...",
"nGood Luck!!")
health = 100
zombies = random.randint(10,20)
reload = 0
inventory = ()
if not inventory:
print("You have nothing.")
response = None
while response!="no":
response=input("Would you like to add an item?")
if response == "yes":
print("You can take into your inventoryn1.Shotgunn2.Flamethrowern3.Airstrike Targetern4.Wet Noodle")
item=input("What will you take? Add numbers when adding to inventory.")
inventory = inventory + (item,)
print("This is your inventory:")
for inv in inventory:
print(inv)
while health > 0 and zombies > 0:
print("There are", zombies, "zombies snarling in front of you.n")
action = int(input("What will you do? type the number of the inventory item."))
if action == 1:
attack = random.randint(1,5)
zombies = zombies - attack
print("Bang!!!, Click Click, Bang!!!n")
if zombies > 0:
print("You have killed", attack, "zombies.")
else:
print("You have killed all of the zombies!!.")
elif action == 2:
attack = random.randint(5,10)
zombies = zombies - attack
print("You shout, "This is my firey friend!!!" and burn them to ashes.n")
if zombies > 0:
print("You have killed", attack, "zombies.")
print("You will have to wait three round to gain reinforcments.")
...
...