Advertisement
CJtonth

Untitled

Nov 21st, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. game = str(input("What game do you want to play? "))
  2. import random as r
  3. A = 11
  4. J = 10
  5. Q = 10
  6. K = 10
  7. cardss = ["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]
  8. cards = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
  9. q=0
  10. blsetup=0
  11. player=[]
  12. dealer=[]
  13. ptotal=[]
  14. dtotal=[]
  15. while q != 1:
  16. if game == "blackjack":
  17. blackjack =1
  18. while blackjack == 1:
  19. blsetup = 0
  20. player = []
  21. dealer = []
  22. ptotal = []
  23. dtotal = []
  24. while blsetup !=2:
  25. rando=r.randint(0,12)
  26. dcard = (cards[rando])
  27. dtotal.append(dcard)
  28. dealer.append(cardss[rando])
  29. rando = r.randint(0, 12)
  30. pcard = (cards[rando])
  31. ptotal.append(pcard)
  32. player.append(cardss[rando])
  33. blsetup = blsetup+ 1
  34. pcount=sum(ptotal)
  35. print("Your cards are", player, "Your total is", pcount)
  36. print("The dealer shows", dealer[-1])
  37. hos = str(input("do you want to hit or stay?"))
  38. while hos == "hit" and pcount<22:
  39. rando = r.randint(0, 12)
  40. pcard = (cards[rando])
  41. ptotal.append(pcard)
  42. player.append(cardss[rando])
  43. pcount = sum(ptotal)
  44. print("Your cards are", player, "Your total is", pcount)
  45. if pcount > 21 :
  46. print("You have busted")
  47. hos = str(input("do you want to hit or stay?"))
  48. elif game == "roulette":
  49. exit()
  50.  
  51.  
  52.  
  53. exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement