"""Ordered list of face cards.
"""
-DECK = [(c/4, c%4) for c in range(52)]
-"""Cards in the deck are stored as (n,m), where `n` is the rank number
-`n=[0,12]`, and `m` is the suit `m=[0,3]`.
+def new_deck():
+ """Generate a new deck.
-Examples:
- (0,1) is a two of hearts,
- (11,0) is a king of spades,
- (12,3) is an ace of clubs
+ Cards in the deck are stored as `(n,m)`, where `n` is the rank
+ number `n=[0,12]`, and `m` is the suit `m=[0,3]`.
->>> DECK[:5]
-"""
+ Examples:
+ * `(0,1)` is a two of hearts,
+ * `(11,0)` is a king of spades,
+ * `(12,3)` is an ace of clubs
+
+ >>> deck = new_deck()
+ >>> deck[:6]
+ [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1)]
+ >>> [pp_card(c) for c in deck[:6]]
+ ['2s', '2h', '2d', '2c', '3s', '3h']
+ """
+ return [(c/4, c%4) for c in range(52)]
def pp_card(card):
"""Pretty-print a card.