Card Dealer¶
New in version 0.8.
This function deal cards from a defined deck.
This function has different implementation if the numpy is not avilable.
Example Usage¶
Deal five cards:
cards = signalz.card_dealer(5)
Deal two cards for 3 players (array with dimmension 3x2):
cards = signalz.card_dealer(2, players=3)
Add 2 wild cards to the deck and build deck from two such a decks:
cards = signalz.card_dealer(2, deck="standard+wild", decks_number=2)
You can also provide a custom deck:
my_deck = ["A1", "A2", "B1", "B2"]
cards = signalz.card_dealer(2, deck=my_deck)
Function Documentation¶
-
signalz.generators.card_dealer.
card_dealer
(cards_dealt, players=1, deck='standard', decks_number=1)[source]¶ This function return randomly dealt cards for defined number of players.
Args: * cards_dealt : number of cards for each player (int) * players : number of players
Kwargs: * deck : options are:
- standard (str) - standard playging deck with 52 cards
- standard+wild (str) - standard playing deck extended with two wildcards (w1, w2)
- any list/tuple obtaining strings representing custom cards
- deck_number : number of decks from which are cards dealt (some rummy games use more than one)
Returns: * list of lists - list cointains list of holdings for each player
-
signalz.generators.card_dealer.
card_dealer_numpy
(cards_dealt, players=1, deck='standard', decks_number=1)[source]¶ This function return randomly dealt cards for defined number of players.
Args: * cards_dealt : number of cards for each player (int) * players : number of players
Kwargs: * deck : options are:
- standard (str) - standard playging deck with 52 cards
- standard+wild (str) - standard playing deck extended with two wildcards (w1, w2)
- any list/tuple obtaining strings representing custom cards
- deck_number : number of decks from which are cards dealt (some rummy games use more than one)
Returns: * numpy 2d array - every row represents one player