Last active
September 12, 2021 01:40
-
-
Save JosephTLyons/87142845b435f4800767d84d51bfefc8 to your computer and use it in GitHub Desktop.
A ridiculous, minimalist, code-golf approach to displaying a shuffled deck of cards
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
| import random | |
| c = [(r, s) for s in ["♠️", "♦️", "♣️", "❤️"] for r in ["A", *list(range(2, 11)), "J", "Q", "K"]] | |
| random.shuffle(c) | |
| print("\n".join([f"{str(r).rjust(2, ' ')} {s}" for r, s in c])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment