Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1.  
  2. Suits = (
  3.     'Spades',
  4.     'Hearts',
  5.     'Clubs',
  6.     'Diamonds'
  7. )
  8.  
  9. Cards = (
  10.     'Six',
  11.     'Seven',
  12.     'Eight',
  13.     'Nine',
  14.     'Ten',
  15.     'Jack',
  16.     'Queen',
  17.     'King',
  18.     'Ace'
  19. )
  20.  
  21. trump = input("SELECT A TRUMP: " + ', '.join(Suits) + "\n")
  22.  
  23. print("HELLO USER1, INPUT A CARD", ', '.join(Cards) + "\n")
  24. user1_card = input("Input a card:")
  25. user1_suit = input("Input a suit:")
  26.  
  27. print("HELLO USER2, INPUT A CARD")
  28. user2_card = input("Input a card:")
  29. user2_suit = input("Input a suit:")
  30.  
  31.  
  32. user1_has_trump = False
  33. user2_has_trump = False
  34.  
  35. if user1_suit == trump:
  36.     user1_has_trump = True
  37.  
  38. if user2_suit == trump:
  39.     user2_has_trump = True
  40.  
  41. # + +
  42. if user1_has_trump and user2_has_trump:
  43.     if Cards.index(user1_card) > Cards.index(user2_card):
  44.         print("USER 1 WON!!!")
  45.     elif Cards.index(user2_card) > Cards.index(user1_card):
  46.         print("USER 2 WON!!!")
  47.     else:
  48.         print("Draw!")
  49.     exit(0)
  50.  
  51.  
  52.  
  53. # + -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement