Hey Coders,
I'm making a 'Pick-a-Number' Game, in Python. I need it to be if you correctly guess the number it will add how much your bet was to your money. I was wondering how to do this. Here's my code (Copyright):
CODE
import time
import random
print ".: Welcome To P.A.N! We Hope You Win! You Will Start With 100 Credits! Enjoy! :."
print "--- Created By: M4V3R1CK ---"
print ""
print "----------"
print ""
money2 = "100"
res1 = raw_input("Would You Like To Start The Game? Y/N: ")
while res1 == "y":
print ""
print "----------"
print "Here Are The Numbers You May Pick:"
print ""
print "--"
print ""
print "=[ 1 ]="
print "=[ 2 ]="
print "=[ 3 ]="
print "=[ 4 ]="
print "=[ 5 ]="
print ""
print "--"
print ""
print "Place Your Bet (Be Sure Not To Include A Dollar Sign, e.g 29. Not $29"
print "You currently Have: "
print money2
print "Credits"
res2 = raw_input("Bet: ")
print ""
time.sleep(2)
print "Bet Accepted!"
print ""
print "Now, Enter A Number Between 1 and 5"
res3 = raw_input("Number: ")
print ""
time.sleep(2)
print "Number Accepted!"
print ""
res4 = raw_input("Would You Like To See The Number? Y/N: ")
if res4 == "n":
time.sleep(1)
print ""
print "Well.. This Is A Waste Of Time!"
time.sleep(3)
exit();
else:
print ""
print "Selecting A Number Please Wait..."
print ""
time.sleep(3)
result = random.randint(1,5)
if result == 1:
if res3 == "1":
print "=[ 1 ]="
print ""
print "Oh My Gosh! You Just Won:"
print res2
print "Credits!"
else:
print "=[ 1 ]="
print ""
print "Oh No! You Lost:"
print res2
print "Credits!"
if result == 2:
if res3 == "2":
print "=[ 2 ]="
print ""
print "Oh My Gosh! You Just Won:"
print res2
print "Credits!"
else:
print "=[ 2 ]="
print ""
print "Oh No! You Lost:"
print res2
print "Credits!"
if result == 3:
if res3 == "3":
print "=[ 3 ]="
print ""
print "Oh My Gosh! You Just Won:"
print res2
print "Credits!"
else:
print "=[ 3 ]="
print ""
print "Oh No! You Lost:"
print res2
print "Credits!"
if result == 4:
if res3 == "4":
print "=[ 4 ]="
print ""
print "Oh My Gosh! You Just Won:"
print res2
print " Credits!"
else:
print "=[ 4 ]="
print ""
print "Oh No! You Lost:"
print res2
print "Credits!"
if result == 5:
if res3 == "5":
print "=[ 5 ]="
print ""
print "Oh My Gosh! You Just Won:"
print res2
print "Credits!"
else:
print "=[ 5 ]="
print ""
print "Oh No! You Lost:"
print res2
print "Credits!"
time.sleep(3)
print ""
print "----------"
print ""
res1 = raw_input("Would You Like To Play Again? Y/N: ")
print ""
time.sleep(1)
print "Okay Then! Bye!"
time.sleep(1)
exit();
Any Suggestions Are Helpful! Thanks!