Advertisement
mburton2

Untitled

Sep 10th, 2014
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | None | 0 0
  1. import random
  2.  
  3. Random = random.randint(0,51)
  4. popcorn = [1, 2, 3, 4, 5]
  5. numbers = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A']
  6. spades = ['SP' + '1','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP']
  7. hearts = ['HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE']
  8. diamonds = ['DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI']
  9. clubs = ['CL','CL','CL','CL','CL','CL','CL','CL','CL','CL','CL','CL','CL']
  10.  
  11. def deckblder(numbers, spades, hearts, diamonds, clubs):
  12.     numbersd = zip(numbers, diamonds)
  13.     numbersh = zip(numbers, hearts)
  14.     numberss = zip(numbers, spades)
  15.     numbersc = zip(numbers, clubs)
  16.     deck = numbersd + popcorn + numbersh + numberss + numbersc
  17.     return deck
  18.    
  19. cards = deckblder(numbers, spades, hearts, diamonds, clubs)
  20. #print cards.pop(Random)
  21.  
  22. def dealer(cards):
  23.     ask = int(raw_input('How many cards? '))
  24.     rag = range(0, ask)
  25.     rag2 = 52
  26.     hand = []
  27.     for num in rag:
  28.         rag2 = rag2 - 1
  29.         Random = random.randint(0,rag2)
  30.         deal = cards.pop(Random)
  31.        
  32.         hand.append(deal), hand.append(popcorn[0])
  33.    
  34.     return hand
  35.    
  36.    
  37.    
  38. play = dealer(cards)
  39. print play
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement