Skip to content

Instantly share code, notes, and snippets.

@armanbilge
Created May 20, 2017 12:35
Show Gist options
  • Save armanbilge/1d2623874b912b6401308d42397864e0 to your computer and use it in GitHub Desktop.
Save armanbilge/1d2623874b912b6401308d42397864e0 to your computer and use it in GitHub Desktop.
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))
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