Exemple #1
0
def random_cards(count=1):
    if count == 1:
        return Card(random.choice(list(RANKS.values())),
                    random.choice(list(SUITS.values())))

    cards = set()
    while len(cards) < count:
        cards.add(Card(random.choice(list(RANKS.values())),
                       random.choice(list(SUITS.values()))))

    return cards
Exemple #2
0
def random_cards(count=1):
    if count == 1:
        return Card(random.choice(list(RANKS.values())),
                    random.choice(list(SUITS.values())))

    cards = set()
    while len(cards) < count:
        cards.add(
            Card(random.choice(list(RANKS.values())),
                 random.choice(list(SUITS.values()))))

    return cards
Exemple #3
0
 def setUp(self):
     self.deck = [
         Card(rank, suit) for rank in RANKS.values()
         for suit in SUITS.values()
     ]
Exemple #4
0
 def setUp(self):
     self.deck = [Card(rank, suit) for rank in RANKS.values()
                  for suit in SUITS.values()]