Guest User

Untitled

a guest
Feb 20th, 2018
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 9.56 KB | None | 0 0
  1. #############################################
  2. #           GamingSydney Blackjack          #
  3. #   Made by Harrison Walton - Alicarnassum  #
  4. #       harrison.walton.hinder@gmail.com    #
  5. #           For compilation in Py26         #
  6. #############################################
  7. import random
  8. i = 0
  9. Cards = ["Ace of Hearts", "Ace of Diamonds", "Ace of Spades", "Ace of Clubs",
  10.          "Two of Hearts", "Two of Diamonds", "Two of Spades", "Two of Clubs",
  11.          "Three of Hearts", "Three of Diamonds", "Three of Spades", "Three of Clubs",
  12.          "Four of Hearts", "Four of Diamonds", "Four of Spades", "Four of Clubs",
  13.          "Five of Hearts", "Five of Diamonds", "Five of Spades", "Five of Clubs",
  14.          "Six of Hearts", "Six of Diamonds", "Six of Spades", "Six of Clubs",
  15.          "Seven of Hearts", "Seven of Diamonds", "Seven of Spades", "Seven of Clubs",
  16.          "Eight of Hearts", "Eight of Diamonds", "Eight of Spades", "Eight of Clubs",
  17.          "Nine of Hearts", "Nine of Diamonds", "Nine of Spades", "Nine of Clubs",
  18.          "Ten of Hearts", "Ten of Diamonds", "Ten of Spades", "Ten of Clubs",
  19.          "Jack of Hearts", "Jack of Diamonds", "Jack of Spades", "Jack of Clubs",
  20.          "Queen of Hearts", "Queen of Diamonds", "Queen of Spades", "Queen of Clubs",
  21.          "King of Hearts", "King of Diamonds", "King of Spades", "King of Clubs"]
  22.  
  23. FirstName = ["James", "Richard", "Harrison", "Robert", "Ronaldo", "Pinkie", "Wade", "Spike", "Soap", "Michael"]
  24. LastName = ["Galaghan", "Kadzait", "Walton", "Banner", "Sanchez", "Pie", "Caesar", "Dragon", "McTavish", "Saliba"]
  25. CardsLeft = len(Cards)
  26. random.shuffle(Cards)
  27. random.shuffle(FirstName)
  28. random.shuffle(LastName)
  29. DealerName = FirstName[0] +" "+ LastName[0]
  30. Score = 0
  31. DealerScore = 0
  32. BlackJack = False
  33. Bust = False
  34. DealerTurn = True
  35. Split = False
  36.  
  37. Card1 = 0
  38. Card2 = 0
  39.  
  40. print "Hello sir! My name is", DealerName, "and I shall be your dealer today!"
  41.  
  42. print "You have been dealt the", Cards[i]
  43.  
  44. if "Ace" in Cards[i]:
  45.     AceCheck = raw_input("Use this as a 1 or an 11? ")
  46.     if AceCheck == "1":
  47.         Score = Score + 1
  48.     if AceCheck == "11":
  49.         Score = Score + 11
  50.     Card1 = "Ace"
  51. if "Two" in Cards[i]:
  52.     Score = Score + 2
  53.     Card1 = "Two"
  54. if "Three" in Cards[i]:
  55.     Score = Score + 3
  56.     Card1 = "Three"
  57. if "Four" in Cards[i]:
  58.     Score = Score + 4
  59.     Card1 = "Four"
  60. if "Five" in Cards[i]:
  61.     Score = Score + 5
  62.     Card1 = "Five"
  63. if "Six" in Cards[i]:
  64.     Score = Score + 6
  65.     Card1 = "Six"
  66. if "Seven" in Cards[i]:
  67.     Score = Score + 7
  68.     Card1 = "Seven"
  69. if "Eight" in Cards[i]:
  70.     Score = Score + 8
  71.     Card1 = "Eight"
  72. if "Nine" in Cards[i]:
  73.     Score = Score + 9
  74.     Card1 = "Nine"
  75. if "Ten" in Cards[i]:
  76.     Score = Score + 10
  77.     Card1 = "Ten"
  78. if "Jack" in Cards[i]:
  79.     Score = Score + 10
  80.     Card1 = "Jack"
  81. if "Queen" in Cards[i]:
  82.     Score = Score + 10
  83.     Card1 = "Queen"
  84. if "King" in Cards[i]:
  85.     Score = Score + 10
  86.     Card1 = "King"
  87.  
  88. Cards.remove(Cards[i])
  89. CardsLeft = len(Cards)
  90.  
  91. print DealerName, "Deals himself the", Cards[i]
  92.  
  93. if "Ace" in Cards[i]:
  94.     if DealerScore > 10:
  95.         DealerScore = Score + 1
  96.     if DealerScore < 11:
  97.         DealerScore = Score + 11
  98. if "Two" in Cards[i]:
  99.     DealerScore = DealerScore + 2
  100. if "Three" in Cards[i]:
  101.     DealerScore = DealerScore + 3
  102. if "Four" in Cards[i]:
  103.     DealerScore = DealerScore + 4
  104. if "Five" in Cards[i]:
  105.     DealerScore = DealerScore + 5
  106. if "Six" in Cards[i]:
  107.     DealerScore = DealerScore + 6
  108. if "Seven" in Cards[i]:
  109.     DealerScore = DealerScore + 7
  110. if "Eight" in Cards[i]:
  111.     DealerScore = DealerScore + 8
  112. if "Nine" in Cards[i]:
  113.     DealerScore = DealerScore + 9
  114. if "Ten" in Cards[i]:
  115.     DealerScore = DealerScore + 10
  116. if "Jack" in Cards[i]:
  117.     DealerScore = DealerScore + 10
  118. if "Queen" in Cards[i]:
  119.     DealerScore = DealerScore + 10
  120. if "King" in Cards[i]:
  121.     DealerScore = DealerScore + 10
  122.  
  123. DealerCard1 = Cards[i]
  124. Cards.remove(Cards[i])
  125. CardsLeft = len(Cards)
  126.  
  127. print "You have also been dealt the", Cards[0]
  128.  
  129. if "Ace" in Cards[i]:
  130.     AceCheck = raw_input("Use this as a 1 or an 11? ")
  131.     if AceCheck == "1":
  132.         Score = Score + 1
  133.     if AceCheck == "11":
  134.         Score = Score + 11
  135.     Card2 = "Ace"
  136. if "Two" in Cards[i]:
  137.     Score = Score + 2
  138.     Card2 = "Two"
  139. if "Three" in Cards[i]:
  140.     Score = Score + 3
  141.     Card2 = "Three"
  142. if "Four" in Cards[i]:
  143.     Score = Score + 4
  144.     Card2 = "Four"
  145. if "Five" in Cards[i]:
  146.     Score = Score + 5
  147.     Card2 = "Five"
  148. if "Six" in Cards[i]:
  149.     Score = Score + 6
  150.     Card2 = "Six"
  151. if "Seven" in Cards[i]:
  152.     Score = Score + 7
  153.     Card2 = "Seven"
  154. if "Eight" in Cards[i]:
  155.     Score = Score + 8
  156.     Card2 = "Eight"
  157. if "Nine" in Cards[i]:
  158.     Score = Score + 9
  159.     Card2 = "Nine"
  160. if "Ten" in Cards[i]:
  161.     Score = Score + 10
  162.     Card2 = "Ten"
  163. if "Jack" in Cards[i]:
  164.     Score = Score + 10
  165.     Card2 = "Jack"
  166. if "Queen" in Cards[i]:
  167.     Score = Score + 10
  168.     Card2 = "Queen"
  169. if "King" in Cards[i]:
  170.     Score = Score + 10
  171.     Card2 = "King"
  172.    
  173. Cards.remove(Cards[i])
  174. CardsLeft = len(Cards)
  175.  
  176. print DealerName, "Deals himself a card"
  177.  
  178. if "Ace" in Cards[i]:
  179.     if DealerScore > 10:
  180.         DealerScore = Score + 1
  181.     if DealerScore < 11:
  182.         DealerScore = Score + 11
  183. if "Two" in Cards[i]:
  184.     DealerScore = DealerScore + 2
  185. if "Three" in Cards[i]:
  186.     DealerScore = DealerScore + 3
  187. if "Four" in Cards[i]:
  188.     DealerScore = DealerScore + 4
  189. if "Five" in Cards[i]:
  190.     DealerScore = DealerScore + 5
  191. if "Six" in Cards[i]:
  192.     DealerScore = DealerScore + 6
  193. if "Seven" in Cards[i]:
  194.     DealerScore = DealerScore + 7
  195. if "Eight" in Cards[i]:
  196.     DealerScore = DealerScore + 8
  197. if "Nine" in Cards[i]:
  198.     DealerScore = DealerScore + 9
  199. if "Ten" in Cards[i]:
  200.     DealerScore = DealerScore + 10
  201. if "Jack" in Cards[i]:
  202.     DealerScore = DealerScore + 10
  203. if "Queen" in Cards[i]:
  204.     DealerScore = DealerScore + 10
  205. if "King" in Cards[i]:
  206.     DealerScore = DealerScore + 10
  207.  
  208. DealerCard2 = Cards[i]
  209. Cards.remove(Cards[i])
  210. CardsLeft = len(Cards)
  211.  
  212. #print Score
  213. #print DealerScore
  214.  
  215. if Score == 21:
  216.     print "Blackjack!"
  217.     BlackJack = True
  218.     DealerTurn = False
  219.     CardsLeft = 0
  220.    
  221. if Score > 21:
  222.     print "Bust with", Score
  223.     Bust = True
  224.     CardsLeft = 0
  225.     DealerTurn = False
  226.  
  227. if Score < 21:
  228.     Input = raw_input("Hit or stay? ")
  229.     if Input == "stay":
  230.         CardsLeft = 0
  231.     if Input == "hit":
  232.         CardsLeft = CardsLeft
  233.  
  234. while CardsLeft != 0:
  235.     print "You drew a", Cards[i]
  236.     if "Ace" in Cards[i]:
  237.         AceCheck = raw_input("Use this as a 1 or an 11? ")
  238.         if AceCheck == "1":
  239.             Score = Score + 1
  240.         if AceCheck == "11":
  241.             Score = Score + 11
  242.     if "Two" in Cards[i]:
  243.         Score = Score + 2
  244.     if "Three" in Cards[i]:
  245.         Score = Score + 3
  246.     if "Four" in Cards[i]:
  247.         Score = Score + 4
  248.     if "Five" in Cards[i]:
  249.         Score = Score + 5
  250.     if "Six" in Cards[i]:
  251.         Score = Score + 6
  252.     if "Seven" in Cards[i]:
  253.         Score = Score + 7
  254.     if "Eight" in Cards[i]:
  255.         Score = Score + 8
  256.     if "Nine" in Cards[i]:
  257.         Score = Score + 9
  258.     if "Ten" in Cards[i]:
  259.         Score = Score + 10
  260.     if "Jack" in Cards[i]:
  261.         Score = Score + 10
  262.     if "Queen" in Cards[i]:
  263.         Score = Score + 10
  264.     if "King" in Cards[i]:
  265.         Score = Score + 10
  266.     Cards.remove(Cards[i])
  267.     CardsLeft = len(Cards)
  268.  
  269.     if Score < 21:
  270.         Input = raw_input("Hit or Stay? ")
  271.         if Input == "stay":
  272.             CardsLeft = 0
  273.         if Input == "hit":
  274.             CardsLeft = CardsLeft
  275.     if Score == 21:
  276.         print "Blackjack!"
  277.         BlackJack = True
  278.         DealerTurn = False
  279.         CardsLeft = 0
  280.     if Score > 21:
  281.         print "Bust with", Score
  282.         Bust = True
  283.         CardsLeft = 0
  284.         DealerTurn = False
  285.  
  286. print DealerName + "'s first card is the", DealerCard1
  287. print DealerName, "flips over his other card and it's the", DealerCard2
  288.  
  289. while DealerTurn == True:
  290.     if DealerScore > Score and DealerScore < 21:
  291.         print "House wins"
  292.         DealerTurn = False
  293.     elif DealerScore < 17:
  294.         print DealerName, "Draws another card, it's the", Cards[i]
  295.         if "Ace" in Cards[i]:
  296.             if DealerScore > 10:
  297.                 DealerScore = Score + 1
  298.             if DealerScore < 11:
  299.                 DealerScore = Score + 11
  300.         if "Two" in Cards[i]:
  301.             DealerScore = DealerScore + 2
  302.         if "Three" in Cards[i]:
  303.             DealerScore = DealerScore + 3
  304.         if "Four" in Cards[i]:
  305.             DealerScore = DealerScore + 4
  306.         if "Five" in Cards[i]:
  307.             DealerScore = DealerScore + 5
  308.         if "Six" in Cards[i]:
  309.             DealerScore = DealerScore + 6
  310.         if "Seven" in Cards[i]:
  311.             DealerScore = DealerScore + 7
  312.         if "Eight" in Cards[i]:
  313.             DealerScore = DealerScore + 8
  314.         if "Nine" in Cards[i]:
  315.             DealerScore = DealerScore + 9
  316.         if "Ten" in Cards[i]:
  317.             DealerScore = DealerScore + 10
  318.         if "Jack" in Cards[i]:
  319.             DealerScore = DealerScore + 10
  320.         if "Queen" in Cards[i]:
  321.             DealerScore = DealerScore + 10
  322.         if "King" in Cards[i]:
  323.             DealerScore = DealerScore + 10
  324.         Cards.remove(Cards[i])
  325.     elif DealerScore > 21:
  326.         print "House Busts with", DealerScore, "You win!"
  327.         DealerTurn = False
  328.     elif DealerScore == 21:
  329.         print "House Blackjack, You Lose"
  330.         DealerTurn = False
  331.     elif DealerScore == Score:
  332.         print "Point tie, House Wins"
  333.         DealerTurn = False
Add Comment
Please, Sign In to add comment