Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. import random
  2. import time
  3. from graphics import *
  4. userHV = 0
  5. bet = ()
  6. dealt=False
  7. uValue=[]
  8. AIHand=[]
  9. AIHV=0
  10. AiLength=[]
  11. class cards():
  12. # initiating cardVs
  13. def __init__(self):
  14. self.ini=['c2','c3','c4','c5','c6','c7','c8','c9','c10','cJ','cQ','cK','cA',
  15. 's2','s3','s4','s5','s6','s7','s8','s9','s10','sJ','sQ','sK','sA',
  16. 'h2','h3','h4','h5','h6','h7','h8','h9','h10','hJ','hQ','hK','hA',
  17. 'd2','d3','d4','d5','d6','d7','d8','d9','d10','dJ','dQ','dK','dA']
  18. # clearing randomized deck
  19. # clearing suit num and b cardVs
  20. # creating function deck which randomizes deck
  21. def deck(self):
  22. # while there is something in the list deck
  23. self.b=random.choice(self.ini)
  24. # appending that random cardV to list ranDeck
  25. self.Inplay= self.ini
  26. if self.b in self.ini:
  27. self.ini.remove(self.b)
  28. self.inplay=[]
  29. self.inplay.append(self.ini)
  30. # calling to method that will classify suit and number
  31. self.call()
  32.  
  33.  
  34. def call(self):
  35. if "c" in self.b:
  36. self.suit = "c"
  37. elif "s" in self.b:
  38. self.suit = "s"
  39. elif "h" in self.b:
  40. self.suit = "h"
  41. elif "d" in self.b:
  42. self.suit = "d"
  43. if "J" in self.b:
  44. self.num = "J"
  45. self.value = 10
  46. elif "Q" in self.b:
  47. self.num = "Q"
  48. self.value = 10
  49. elif "K" in self.b:
  50. self.num = "K"
  51. self.value = 10
  52. elif "A" in self.b:
  53. self.num = "A"
  54. self.value = 11
  55. else:
  56. self.num=self.b[1:]
  57. self.value = self.num
  58. return self.num and self.value and self.suit
  59. win = GraphWin("Casino", 500, 500)
  60. class game():
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement