Represents a single french-design card with it’s rank and suit.
Cards can be compared and ordered by rank. A card, relative to a card of the same rank but different suit, is compared as neither higher, lower nor equal.
Parameters: | |
---|---|
Raises : | ValueError |
Create a list of new cards.
Each argument should describe one card with rank and suit together.
Parameters: | args – One or more cards. |
---|---|
Returns: | List of new cards, one for each input parameter. |
Return type: | list of pokercards.cards.Card objects |
Raises : | ValueError |
Represents a single deck of 52 card.Card objects.
The deck could be imagined face down on a table. All internal lists represent the cards in order from bottom up. So dealing the top card means poping last item from the list.
Deal the top card from the deck.
Returns: | pokercards.cards.Card instance |
---|
Shuffle the deck.
Compute the best hand from given cards, implementing traditional “high” poker hand ranks.
The hand object can be given more than five cards (as in Texas Hold’em or similar variants) and the evaluation will pick the best hand.
Evaluated pokercards.cards.PokerHand objects are compared and sorted by the rank of the hand.
List of pokercards.cards.Card objects to make the hand from. The pokercards.cards.PokerHand.evaluate() method should be called after manual update to re-evaluate the updated hand.
Following attributes are available after evaluating the hand.
Readonly rank of the hand (0 = high card to 8 = straight flush)
Readonly list of cards which complete the rank.
Readonly list of extra cards which can break a tie.
Parameters: |
|
---|