Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 3
0
 def setUp(self):
     self.deck = [Card(rank, suit) for rank in RANKS.values()
                  for suit in SUITS.values()]
Exemplo n.º 4
0
 def setUp(self):
     self.deck = [
         Card(rank, suit) for rank in RANKS.values()
         for suit in SUITS.values()
     ]