Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def blackjack():
- playerMoney = 100
- dealerMoney = 200
- while playerMoney >= 5 or dealerMoney >=10:
- bet = int(raw_input('Bet 10, or 5: '))
- if bet == 10 or bet == 5:
- remainingMoney = playerMoney - bet
- print "Your remaining money is: ", remainingMoney
- else:
- print "Invalid"
- else:
- print "No more money!"
- def betting():
- bet = int(raw_input('Bet 10, or 5: '))
- if bet == 10 or bet == 5:
- remainingMoney = playerMoney - bet
- print "You bet ", bet
- print "Your remaining money is: ", remainingMoney
- getCard()
- def getCard():
- cards = {'SA' : 11,
- 'S2': 2,
- 'S10': 10}
- hand = random.sample(cards,2)
- firstCard = cards[hand[0]]
- secondCard = cards[hand[1]]
- cardSet = firstCard + secondCard
- if cardSet == 21:
- print "Blackjack!"
- def playerMove():
- move = raw_input(""" If hit: press 'o'\
- if double down: press 'oo'\
- if stand: press x""")
- if move == 'o':
- getCard()
- if move == 'oo':
- getCard()
- bet * 2
- if move == 'x':
- dealerMove()
- def dealerMove():
Advertisement
Add Comment
Please, Sign In to add comment