Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game = str(input("What game do you want to play? "))
- import random as r
- A = 11
- J = 10
- Q = 10
- K = 10
- cardss = ["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]
- cards = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
- q=0
- blsetup=0
- player=[]
- dealer=[]
- ptotal=[]
- dtotal=[]
- while q != 1:
- if game == "blackjack":
- blackjack =1
- while blackjack == 1:
- blsetup = 0
- player = []
- dealer = []
- ptotal = []
- dtotal = []
- while blsetup !=2:
- rando=r.randint(0,12)
- dcard = (cards[rando])
- dtotal.append(dcard)
- dealer.append(cardss[rando])
- rando = r.randint(0, 12)
- pcard = (cards[rando])
- ptotal.append(pcard)
- player.append(cardss[rando])
- blsetup = blsetup+ 1
- pcount=sum(ptotal)
- print("Your cards are", player, "Your total is", pcount)
- print("The dealer shows", dealer[-1])
- hos = str(input("do you want to hit or stay?"))
- while hos == "hit" and pcount<22:
- rando = r.randint(0, 12)
- pcard = (cards[rando])
- ptotal.append(pcard)
- player.append(cardss[rando])
- pcount = sum(ptotal)
- print("Your cards are", player, "Your total is", pcount)
- if pcount > 21 :
- print("You have busted")
- hos = str(input("do you want to hit or stay?"))
- elif game == "roulette":
- exit()
- exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement