Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random, time
- print('Three Card Monte')
- print()
- print()
- print(' ___ ___ ___')
- print('|Q | |8 | |K |')
- print('| ♥ | | ♠ | | ♣ |')
- print('|__Q| |__8| |__K|')
- print()
- print('Keep an eye on the Queen of Hearts: left-middle-right')
- print('Press Enter to begin...')
- input()
- # 0 1 2
- cards = ['Q', '8', 'K']
- for i in range(1600):
- swap = random.choice(['LM', 'LR', 'MR', 'ML', 'RL', 'RM'])
- if swap == 'LM':
- cards[0], cards[1] = cards[1], cards[0]
- print('swapping left and middle...')
- elif swap == 'LR':
- cards[0], cards[2] = cards[2], cards[0]
- print('swapping left and right...')
- elif swap == 'MR':
- cards[1], cards[2] = cards[2], cards[1]
- print('swapping middle and right...')
- elif swap == 'ML':
- cards[1], cards[0] = cards[0], cards[1]
- print('swapping middle and left...')
- elif swap == 'RL':
- cards[2], cards[0] = cards[0], cards[2]
- print('swapping right and left...')
- elif swap == 'RM':
- cards[2], cards[1] = cards[1], cards[2]
- print('swapping right and middle...')
- time.sleep(0)
- #print('DEBUG', cards)
- print('Where is the Queen of Hearts?')
- print('Enter L, M, or R for left, middle, or right:')
- guess = input().upper()
- if guess == 'L' and cards[0] == 'Q':
- print('You won!')
- elif guess == 'M' and cards[1] == 'Q':
- print('You won!')
- elif guess == 'R' and cards[2] == 'Q':
- print('You won!')
- else:
- print('You lost. :(')
- print('Here are the cards:')
- if cards == ['Q', '8', 'K']:
- print(' ___ ___ ___')
- print('|Q | |8 | |K |')
- print('| ♥ | | ♠ | | ♣ |')
- print('|__Q| |__8| |__K|')
- elif cards == ['Q', 'K', '8']:
- print(' ___ ___ ___')
- print('|Q | |K | |8 |')
- print('| ♥ | | ♣ | | ♠ |')
- print('|__Q| |__K| |__8|')
- elif cards == ['K', 'Q', '8']:
- print(' ___ ___ ___')
- print('|K | |Q | |8 |')
- print('| ♣ | | ♥ | | ♠ |')
- print('|__K| |__Q| |__8|')
- elif cards == ['K', '8', 'Q']:
- print(' ___ ___ ___')
- print('|K | |8 | |Q |')
- print('| ♣ | | ♠ | | ♥ |')
- print('|__K| |__8| |__Q|')
- elif cards == ['8', 'K', 'Q']:
- print(' ___ ___ ___')
- print('|8 | |K | |Q |')
- print('| ♠ | | ♣ | | ♥ |')
- print('|__8| |__K| |__Q|')
- elif cards == ['8', 'Q', 'K']:
- print(' ___ ___ ___')
- print('|8 | |Q | |K |')
- print('| ♠ | | ♥ | | ♣ |')
- print('|__8| |__Q| |__K|')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement