01-11-2008, 10:48 AM
Code:
import sys
gold = True
Prize1 = 2
Prize2 = 1
Selection1 = raw_input
buy = raw_input
store = raw_input
shop = raw_input
Pr1 = True
sword = 250
shield = 250
while True:
try:
Selection1 = int(raw_input("Please choose from 1 or 2.\n"))
except:
print "**Numbers only!**\n"
if Selection1 < 1 or Selection1 > 2:
print"Sorry, I don't understand you!\n"
elif Selection1 == 1:
gold = 0
print "You receive nothing!!!! Try again.\n"
elif Selection1 == 2:
gold = gold + 500
print "You receive 500 gold!\n"
True = False
if gold < 0:
print "I am sorry, but you do not have any gold to visit the store!\n"
else:
shop = str(raw_input("To use the store, say 'store'.\n"))
if shop == 'store':
True = False
store = str(raw_input("Welcome to my store. Would you like to 'buy' something sir?\n"))
if shop != "store":
print "I don't understand."
if store == 'buy':
True = False
buy = str(raw_input("I only have these items for sale, business has been \
rather slow lately. '*You notice him point to a 'sword' and 'shield' collection on the \
shelves*\n"))
elif store != 'buy':
print "bla"
if buy == 'shield' and gold >= shield:
print "Let me get that real quick...\n"
print "*You have received a shield!*\n"
gold = (gold - shield)
print "You now have ", gold, "gold left!\n"
elif buy == 'sword' and gold >= sword:
print "Let me get that real quick...\n"
print "*You have received a sword!*\n"
gold = (gold - sword)
print "You now have ", gold, "gold left!\n"
if gold == 0:
print "I am sorry, but you have ", gold, "gold left. It is not enough to buy any item here! Come back when you have money sir!\n"
Pr1 = False
anyone give me a hand please? I have spent 2 hours editing one area. Someone tell me how I can get
Code:
if shop == 'store':
True = False
store = str(raw_input("Welcome to my store. Would you like to 'buy' something sir?\n"))
if shop != "store":
print "I don't understand."
if store == 'buy':
True = False
buy = str(raw_input("I only have these items for sale, business has been \
rather slow lately. '*You notice him point to a 'sword' and 'shield' collection on the \
shelves*\n"))
elif store != 'buy':
print "bla"
to stop saying:
Quote:Please choose from 1 or 2.
1
You receive nothing!!!! Try again.
Please choose from 1 or 2.
2
You receive 500 gold!
To use the store, say 'store'.
1
I don't understand.
bla
>>> 1
1
>>>