Created
May 20, 2017 12:35
-
-
Save armanbilge/1d2623874b912b6401308d42397864e0 to your computer and use it in GitHub Desktop.
This file contains 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
import sys | |
import itertools as it | |
import random | |
cards = [1] + 5 * [1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 'Sorry!'] | |
shuffled = lambda x: random.sample(x, len(x)) | |
deck = it.chain.from_iterable((shuffled(cards) for _ in it.count())) | |
for l in sys.stdin: | |
print(next(deck)) |
This file contains 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
import sys | |
import itertools as it | |
import random | |
cards = [1] + 5 * [1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 'Sorry!'] | |
shuffled = lambda x: random.sample(x, len(x)) | |
deck = it.chain.from_iterable((shuffled(cards) for _ in it.count())) | |
for l in sys.stdin: | |
print(next(deck)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment