Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #############################################
- # GamingSydney Blackjack #
- # Made by Harrison Walton - Alicarnassum #
- # harrison.walton.hinder@gmail.com #
- # For compilation in Py26 #
- #############################################
- import random
- i = 0
- Cards = ["Ace of Hearts", "Ace of Diamonds", "Ace of Spades", "Ace of Clubs",
- "Two of Hearts", "Two of Diamonds", "Two of Spades", "Two of Clubs",
- "Three of Hearts", "Three of Diamonds", "Three of Spades", "Three of Clubs",
- "Four of Hearts", "Four of Diamonds", "Four of Spades", "Four of Clubs",
- "Five of Hearts", "Five of Diamonds", "Five of Spades", "Five of Clubs",
- "Six of Hearts", "Six of Diamonds", "Six of Spades", "Six of Clubs",
- "Seven of Hearts", "Seven of Diamonds", "Seven of Spades", "Seven of Clubs",
- "Eight of Hearts", "Eight of Diamonds", "Eight of Spades", "Eight of Clubs",
- "Nine of Hearts", "Nine of Diamonds", "Nine of Spades", "Nine of Clubs",
- "Ten of Hearts", "Ten of Diamonds", "Ten of Spades", "Ten of Clubs",
- "Jack of Hearts", "Jack of Diamonds", "Jack of Spades", "Jack of Clubs",
- "Queen of Hearts", "Queen of Diamonds", "Queen of Spades", "Queen of Clubs",
- "King of Hearts", "King of Diamonds", "King of Spades", "King of Clubs"]
- FirstName = ["James", "Richard", "Harrison", "Robert", "Ronaldo", "Pinkie", "Wade", "Spike", "Soap", "Michael"]
- LastName = ["Galaghan", "Kadzait", "Walton", "Banner", "Sanchez", "Pie", "Caesar", "Dragon", "McTavish", "Saliba"]
- CardsLeft = len(Cards)
- random.shuffle(Cards)
- random.shuffle(FirstName)
- random.shuffle(LastName)
- DealerName = FirstName[0] +" "+ LastName[0]
- Score = 0
- DealerScore = 0
- BlackJack = False
- Bust = False
- DealerTurn = True
- Split = False
- Card1 = 0
- Card2 = 0
- print "Hello sir! My name is", DealerName, "and I shall be your dealer today!"
- print "You have been dealt the", Cards[i]
- if "Ace" in Cards[i]:
- AceCheck = raw_input("Use this as a 1 or an 11? ")
- if AceCheck == "1":
- Score = Score + 1
- if AceCheck == "11":
- Score = Score + 11
- Card1 = "Ace"
- if "Two" in Cards[i]:
- Score = Score + 2
- Card1 = "Two"
- if "Three" in Cards[i]:
- Score = Score + 3
- Card1 = "Three"
- if "Four" in Cards[i]:
- Score = Score + 4
- Card1 = "Four"
- if "Five" in Cards[i]:
- Score = Score + 5
- Card1 = "Five"
- if "Six" in Cards[i]:
- Score = Score + 6
- Card1 = "Six"
- if "Seven" in Cards[i]:
- Score = Score + 7
- Card1 = "Seven"
- if "Eight" in Cards[i]:
- Score = Score + 8
- Card1 = "Eight"
- if "Nine" in Cards[i]:
- Score = Score + 9
- Card1 = "Nine"
- if "Ten" in Cards[i]:
- Score = Score + 10
- Card1 = "Ten"
- if "Jack" in Cards[i]:
- Score = Score + 10
- Card1 = "Jack"
- if "Queen" in Cards[i]:
- Score = Score + 10
- Card1 = "Queen"
- if "King" in Cards[i]:
- Score = Score + 10
- Card1 = "King"
- Cards.remove(Cards[i])
- CardsLeft = len(Cards)
- print DealerName, "Deals himself the", Cards[i]
- if "Ace" in Cards[i]:
- if DealerScore > 10:
- DealerScore = Score + 1
- if DealerScore < 11:
- DealerScore = Score + 11
- if "Two" in Cards[i]:
- DealerScore = DealerScore + 2
- if "Three" in Cards[i]:
- DealerScore = DealerScore + 3
- if "Four" in Cards[i]:
- DealerScore = DealerScore + 4
- if "Five" in Cards[i]:
- DealerScore = DealerScore + 5
- if "Six" in Cards[i]:
- DealerScore = DealerScore + 6
- if "Seven" in Cards[i]:
- DealerScore = DealerScore + 7
- if "Eight" in Cards[i]:
- DealerScore = DealerScore + 8
- if "Nine" in Cards[i]:
- DealerScore = DealerScore + 9
- if "Ten" in Cards[i]:
- DealerScore = DealerScore + 10
- if "Jack" in Cards[i]:
- DealerScore = DealerScore + 10
- if "Queen" in Cards[i]:
- DealerScore = DealerScore + 10
- if "King" in Cards[i]:
- DealerScore = DealerScore + 10
- DealerCard1 = Cards[i]
- Cards.remove(Cards[i])
- CardsLeft = len(Cards)
- print "You have also been dealt the", Cards[0]
- if "Ace" in Cards[i]:
- AceCheck = raw_input("Use this as a 1 or an 11? ")
- if AceCheck == "1":
- Score = Score + 1
- if AceCheck == "11":
- Score = Score + 11
- Card2 = "Ace"
- if "Two" in Cards[i]:
- Score = Score + 2
- Card2 = "Two"
- if "Three" in Cards[i]:
- Score = Score + 3
- Card2 = "Three"
- if "Four" in Cards[i]:
- Score = Score + 4
- Card2 = "Four"
- if "Five" in Cards[i]:
- Score = Score + 5
- Card2 = "Five"
- if "Six" in Cards[i]:
- Score = Score + 6
- Card2 = "Six"
- if "Seven" in Cards[i]:
- Score = Score + 7
- Card2 = "Seven"
- if "Eight" in Cards[i]:
- Score = Score + 8
- Card2 = "Eight"
- if "Nine" in Cards[i]:
- Score = Score + 9
- Card2 = "Nine"
- if "Ten" in Cards[i]:
- Score = Score + 10
- Card2 = "Ten"
- if "Jack" in Cards[i]:
- Score = Score + 10
- Card2 = "Jack"
- if "Queen" in Cards[i]:
- Score = Score + 10
- Card2 = "Queen"
- if "King" in Cards[i]:
- Score = Score + 10
- Card2 = "King"
- Cards.remove(Cards[i])
- CardsLeft = len(Cards)
- print DealerName, "Deals himself a card"
- if "Ace" in Cards[i]:
- if DealerScore > 10:
- DealerScore = Score + 1
- if DealerScore < 11:
- DealerScore = Score + 11
- if "Two" in Cards[i]:
- DealerScore = DealerScore + 2
- if "Three" in Cards[i]:
- DealerScore = DealerScore + 3
- if "Four" in Cards[i]:
- DealerScore = DealerScore + 4
- if "Five" in Cards[i]:
- DealerScore = DealerScore + 5
- if "Six" in Cards[i]:
- DealerScore = DealerScore + 6
- if "Seven" in Cards[i]:
- DealerScore = DealerScore + 7
- if "Eight" in Cards[i]:
- DealerScore = DealerScore + 8
- if "Nine" in Cards[i]:
- DealerScore = DealerScore + 9
- if "Ten" in Cards[i]:
- DealerScore = DealerScore + 10
- if "Jack" in Cards[i]:
- DealerScore = DealerScore + 10
- if "Queen" in Cards[i]:
- DealerScore = DealerScore + 10
- if "King" in Cards[i]:
- DealerScore = DealerScore + 10
- DealerCard2 = Cards[i]
- Cards.remove(Cards[i])
- CardsLeft = len(Cards)
- #print Score
- #print DealerScore
- if Score == 21:
- print "Blackjack!"
- BlackJack = True
- DealerTurn = False
- CardsLeft = 0
- if Score > 21:
- print "Bust with", Score
- Bust = True
- CardsLeft = 0
- DealerTurn = False
- if Score < 21:
- Input = raw_input("Hit or stay? ")
- if Input == "stay":
- CardsLeft = 0
- if Input == "hit":
- CardsLeft = CardsLeft
- while CardsLeft != 0:
- print "You drew a", Cards[i]
- if "Ace" in Cards[i]:
- AceCheck = raw_input("Use this as a 1 or an 11? ")
- if AceCheck == "1":
- Score = Score + 1
- if AceCheck == "11":
- Score = Score + 11
- if "Two" in Cards[i]:
- Score = Score + 2
- if "Three" in Cards[i]:
- Score = Score + 3
- if "Four" in Cards[i]:
- Score = Score + 4
- if "Five" in Cards[i]:
- Score = Score + 5
- if "Six" in Cards[i]:
- Score = Score + 6
- if "Seven" in Cards[i]:
- Score = Score + 7
- if "Eight" in Cards[i]:
- Score = Score + 8
- if "Nine" in Cards[i]:
- Score = Score + 9
- if "Ten" in Cards[i]:
- Score = Score + 10
- if "Jack" in Cards[i]:
- Score = Score + 10
- if "Queen" in Cards[i]:
- Score = Score + 10
- if "King" in Cards[i]:
- Score = Score + 10
- Cards.remove(Cards[i])
- CardsLeft = len(Cards)
- if Score < 21:
- Input = raw_input("Hit or Stay? ")
- if Input == "stay":
- CardsLeft = 0
- if Input == "hit":
- CardsLeft = CardsLeft
- if Score == 21:
- print "Blackjack!"
- BlackJack = True
- DealerTurn = False
- CardsLeft = 0
- if Score > 21:
- print "Bust with", Score
- Bust = True
- CardsLeft = 0
- DealerTurn = False
- print DealerName + "'s first card is the", DealerCard1
- print DealerName, "flips over his other card and it's the", DealerCard2
- while DealerTurn == True:
- if DealerScore > Score and DealerScore < 21:
- print "House wins"
- DealerTurn = False
- elif DealerScore < 17:
- print DealerName, "Draws another card, it's the", Cards[i]
- if "Ace" in Cards[i]:
- if DealerScore > 10:
- DealerScore = Score + 1
- if DealerScore < 11:
- DealerScore = Score + 11
- if "Two" in Cards[i]:
- DealerScore = DealerScore + 2
- if "Three" in Cards[i]:
- DealerScore = DealerScore + 3
- if "Four" in Cards[i]:
- DealerScore = DealerScore + 4
- if "Five" in Cards[i]:
- DealerScore = DealerScore + 5
- if "Six" in Cards[i]:
- DealerScore = DealerScore + 6
- if "Seven" in Cards[i]:
- DealerScore = DealerScore + 7
- if "Eight" in Cards[i]:
- DealerScore = DealerScore + 8
- if "Nine" in Cards[i]:
- DealerScore = DealerScore + 9
- if "Ten" in Cards[i]:
- DealerScore = DealerScore + 10
- if "Jack" in Cards[i]:
- DealerScore = DealerScore + 10
- if "Queen" in Cards[i]:
- DealerScore = DealerScore + 10
- if "King" in Cards[i]:
- DealerScore = DealerScore + 10
- Cards.remove(Cards[i])
- elif DealerScore > 21:
- print "House Busts with", DealerScore, "You win!"
- DealerTurn = False
- elif DealerScore == 21:
- print "House Blackjack, You Lose"
- DealerTurn = False
- elif DealerScore == Score:
- print "Point tie, House Wins"
- DealerTurn = False
Add Comment
Please, Sign In to add comment