Beispiel #1
0
def gameinit(name: str, money: int) -> tuple:
    deck = create_deck()
    # deals 5 cards to deck
    hand = PokerHand()
    for i in range(5):
        hand.add(deck.deal())
    player = PokerPlayer(name, money, hand)
    return deck, player
Beispiel #2
0
def create_deck() -> PokerHand:
    deck = PokerHand()
    SUIT = ['♥', '♦', '♣', '♠']
    RANK = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
    for s in SUIT:
        for r in RANK:
            deck.add(PokerCard(r, s))
    # shuffle
    deck.shuffle()
    return deck