Created
May 31, 2022 14:50
-
-
Save marklemay/1e50715a4dbdf18d180bbf3b2480cce2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://en.wikipedia.org/wiki/Three-card_Monte | |
def shuffle(i, cards): | |
""" shuffles a list of cards for i iterations """ | |
tmp = cards | |
cards[0] = cards[1] | |
cards[1] = cards[2] | |
cards[2] = tmp[0] | |
if i > 0: | |
shuffle(i - 1, cards) | |
def three_card_monte(): | |
""" play a game of 3 card monte """ | |
cards = ["queen of hearts", "jack of spades", "jack of clubs"] | |
shuffle(3, cards) | |
pick = int(input("where's the pretty lady (0,1,2)?")) | |
print(cards[pick]) | |
three_card_monte() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment