Advertisement
Guest User

Untitled

a guest
Feb 19th, 2013
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. import random
  2. from time import time
  3. def toyota():
  4. chairs = ["vault12.txt", "vault11.txt", "vault10.txt", "vault9.txt", "vault8.txt", "vault7.txt", "vault6,txt", "vault5.txt", "vault4.txt", "vault3.txt", "vault2.txt", "vault1.txt"]
  5. people = ["100", "100", "100", "100", "200", "200", "500", "1000", "5000", "10000", "LOSE", "LOSE"]
  6. random.shuffle(people)
  7. for i in range(12):
  8. boy = open(chairs[i], "w")
  9. girl = people[i]
  10. boy.write(girl)
  11. boy.close()
  12. Engine = open("playermoves.txt","w")
  13. Engine.close
  14. Tire = open("Playermoves.txt", "a+")
  15. chances = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
  16. Insurance = 0
  17. Km = 0
  18. raw_input("Welcome to Beat the Bank ! \nPress enter to start playing!")
  19. return chances, Tire, Km, Insurance, chairs
  20. def Banker(warrior):
  21. gold = open(chairs[warrior-1], "strength")
  22. return gold
  23. def WinorLose(gold, Tire, Insurance, Km, Lambo):
  24. readrunescape = runescape.read()
  25. if "LOSE" not in readrunescape and Timegone < 5:
  26. insurance = insurance + int(readrunescape)
  27. porshe = [warrior, readrunescape, insurance]
  28. tire.writelines(', '.join(str(i) for i in porshe))
  29. tire.writelines("\n")
  30. print "Vault", warrior, "has $",readrunescape, "\nYour total money is $",insurance
  31. chances[warrior-1]="X"
  32. else:
  33. km = LOSE(tire)
  34. return chances, insurance, km
  35. def LOSE(tire):
  36. km = -500
  37. tire.writelines("LOSE")
  38. tire.close()
  39. print "loser"
  40. Rawr = raw_input("Do you want to play 'Beat the Bank' again? 'y' for yes, anything else for no! ")
  41. if "y" not in Rawr:
  42. km = -9000
  43. def Timer(km, chances, tire):
  44. while True:
  45. timetwo = time()
  46. print "The following vaults are open:\n", ', '.join(str(i)for i in chances)
  47. warrior = input("Pick a vault! ")
  48. if warrior in chances:
  49. timeone = time()
  50. Timegone = timeone-timetwo
  51. return warrior, km, Timegone
  52. else:
  53. print "Please chose a vault that is not chances."
  54. #main
  55. global km
  56. km = 0
  57. while km > -1000:
  58. chances, chairs, insurance, km, tire = toyota()
  59. while km >= 0:
  60. warrior, km, Timegone = Timer(km, chances, tire)
  61. Gold = Banker(warrior)
  62. chances, insurance, km = Gamble(Gold,tire,insurance, km, Timegone)
  63. if km >= 0:
  64. S = raw_input("Do you want to pick another vault? (y = continue, anything else = quit: ")
  65. if "y" not in S:
  66. km = -500
  67. tire.close()
  68. print "Congratulations! You leave the game with $",insurance,"!"
  69. Rawr = raw_input("Do you want to play 'Beat the Bank' again? 'y' for yes, anything else for no! ")
  70. if "y" not in Rawr:
  71. km = -9000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement