Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- from time import time
- def toyota():
- 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"]
- people = ["100", "100", "100", "100", "200", "200", "500", "1000", "5000", "10000", "LOSE", "LOSE"]
- random.shuffle(people)
- for i in range(12):
- boy = open(chairs[i], "w")
- girl = people[i]
- boy.write(girl)
- boy.close()
- Engine = open("playermoves.txt","w")
- Engine.close
- Tire = open("Playermoves.txt", "a+")
- chances = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
- Insurance = 0
- Km = 0
- raw_input("Welcome to Beat the Bank ! \nPress enter to start playing!")
- return chances, Tire, Km, Insurance, chairs
- def Banker(warrior):
- gold = open(chairs[warrior-1], "strength")
- return gold
- def WinorLose(gold, Tire, Insurance, Km, Lambo):
- readrunescape = runescape.read()
- if "LOSE" not in readrunescape and Timegone < 5:
- insurance = insurance + int(readrunescape)
- porshe = [warrior, readrunescape, insurance]
- tire.writelines(', '.join(str(i) for i in porshe))
- tire.writelines("\n")
- print "Vault", warrior, "has $",readrunescape, "\nYour total money is $",insurance
- chances[warrior-1]="X"
- else:
- km = LOSE(tire)
- return chances, insurance, km
- def LOSE(tire):
- km = -500
- tire.writelines("LOSE")
- tire.close()
- print "loser"
- Rawr = raw_input("Do you want to play 'Beat the Bank' again? 'y' for yes, anything else for no! ")
- if "y" not in Rawr:
- km = -9000
- def Timer(km, chances, tire):
- while True:
- timetwo = time()
- print "The following vaults are open:\n", ', '.join(str(i)for i in chances)
- warrior = input("Pick a vault! ")
- if warrior in chances:
- timeone = time()
- Timegone = timeone-timetwo
- return warrior, km, Timegone
- else:
- print "Please chose a vault that is not chances."
- #main
- global km
- km = 0
- while km > -1000:
- chances, chairs, insurance, km, tire = toyota()
- while km >= 0:
- warrior, km, Timegone = Timer(km, chances, tire)
- Gold = Banker(warrior)
- chances, insurance, km = Gamble(Gold,tire,insurance, km, Timegone)
- if km >= 0:
- S = raw_input("Do you want to pick another vault? (y = continue, anything else = quit: ")
- if "y" not in S:
- km = -500
- tire.close()
- print "Congratulations! You leave the game with $",insurance,"!"
- Rawr = raw_input("Do you want to play 'Beat the Bank' again? 'y' for yes, anything else for no! ")
- if "y" not in Rawr:
- km = -9000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement