def DealCard():
    """Generator to yield one card at a time from a deck."""
    deck = cards.GetCards()
    #print("before shuffle, deck:", deck)
    random.shuffle(deck)
    #print ("after shuffle, deck:", deck)
    for card in deck:
        yield card
Exemple #2
0
def DealCard():
    """Generator to yield one card at a time from a deck."""
    deck = cards.GetCards()
    random.shuffle(deck)
    for card in deck:
        yield card
Exemple #3
0
 def __init__(self):
     self._cards = cards.GetCards()
     random.shuffle(self._cards)