ellesehc

blackjack(broken)

Sep 28th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. def blackjack():
  2.     playerMoney = 100
  3.     dealerMoney = 200
  4.     while playerMoney >= 5 or dealerMoney >=10:
  5.         bet = int(raw_input('Bet 10, or 5: '))
  6.         if bet == 10 or bet == 5:
  7.             remainingMoney = playerMoney - bet
  8.             print "Your remaining money is: ", remainingMoney
  9.         else:
  10.             print "Invalid"
  11.     else:
  12.         print "No more money!"
  13.        
  14. def betting():
  15.     bet = int(raw_input('Bet 10, or 5: '))
  16.         if bet == 10 or bet == 5:
  17.             remainingMoney = playerMoney - bet
  18.             print "You bet ", bet
  19.             print "Your remaining money is: ", remainingMoney
  20.             getCard()
  21.  
  22. def getCard():
  23.     cards = {'SA' : 11,
  24.      'S2': 2,
  25.      'S10': 10}
  26.     hand = random.sample(cards,2)
  27.     firstCard = cards[hand[0]]
  28.     secondCard = cards[hand[1]]
  29.     cardSet = firstCard + secondCard
  30.         if cardSet == 21:  
  31.             print "Blackjack!" 
  32. def playerMove():
  33.     move = raw_input(""" If hit: press 'o'\
  34.                          if double down: press 'oo'\
  35.                          if stand: press x""")
  36.     if move == 'o':
  37.     getCard()
  38.     if move == 'oo':
  39.     getCard()
  40.     bet * 2
  41.     if move == 'x':
  42.     dealerMove()
  43.    
  44.  
  45.    
  46. def dealerMove():
Advertisement
Add Comment
Please, Sign In to add comment