PyBaccarat
visit the ministry of silly walks
|
The Shoe class represents a playing card shoe. More...
Public Member Functions | |
def | __init__ (self, number_decks=None) |
Create a shoe of a specified number of decks of playing cards. More... | |
def | reset (self) |
Reset the shoe to start a new shoe. More... | |
def | shuffle (self) |
Shuffle cards in the shoe. More... | |
def | set_cut_card (self, position) |
Assign the cut card position in the shoe. More... | |
def | cut_card_seen (self) |
Return has the cut card been seen? More... | |
def | deal (self) |
Deal a Card from the Shoe. More... | |
def | discard_adjust_baccarat (self, type) |
The discard pile is our shoe prior to the next_card index. More... | |
def | save_shoe (self, filespec) |
Save this shoe to a disk file specified. | |
def | load_shoe (self, filespec) |
Load a shoe from a disk file specified. | |
def | __init__ (self, number_decks=None) |
Create a shoe of a specified number of decks of playing cards. More... | |
def | reset (self) |
Reset the shoe to start a new shoe. More... | |
def | shuffle (self) |
Shuffle cards in the shoe. More... | |
def | set_cut_card (self, position) |
Assign the cut card position in the shoe. More... | |
def | cut_card_seen (self) |
Return has the cut card been seen? More... | |
def | deal (self) |
Deal a Card from the Shoe. More... | |
def | discard_adjust_baccarat (self, type) |
The discard pile is our shoe prior to the next_card index. More... | |
def | save_shoe (self, filespec) |
Save this shoe to a disk file specified. | |
def | load_shoe (self, filespec) |
Load a shoe from a disk file specified. | |
The Shoe class represents a playing card shoe.
That is, a device designed to hold a large number of playing cards, and deliver them to a card game as requested.
The Shoe is normally not changed. Once created, it can be reused many times. Normal operation would use the reset() method to start a new shoe process. The cards within the shoe are shuffled and reused. But once created, a shoe will normally remain until end of game(s).
Example usage:
def pybaccarat.playingcards.Shoe.__init__ | ( | self, | |
number_decks = None |
|||
) |
Create a shoe of a specified number of decks of playing cards.
The default value for number_decks is one.
Different card games use a shoe composed of a different number of decks of cards. Normally a game of Baccarat would use 8 decks. Blackjack might use 1 or 2 or 6. War would use 6.
Example usage:
An alternative syntax has been added. That allows you to create a shoe based on the constructor being passed an array of Cards. That is, each element of the array must be of type Card class. This will allow you to create your own unique shoe.
Example usage:
self | this object pointer reference |
number_decks | integer number of decks. The default value is 1. Legal range is 1 to 12. The alternate constructor will allow you to pass in an arraay of Cards instead of just a single integer for the number of decks. |
ValueError | If the input parameter number_decks is not a legal integer. |
def pybaccarat.playingcards.Shoe.__init__ | ( | self, | |
number_decks = None |
|||
) |
Create a shoe of a specified number of decks of playing cards.
The default value for number_decks is one.
Different card games use a shoe composed of a different number of decks of cards. Normally a game of Baccarat would use 8 decks. Blackjack might use 1 or 2 or 6. War would use 6.
Example usage:
An alternative syntax has been added. That allows you to create a shoe based on the constructor being passed an array of Cards. That is, each element of the array must be of type Card class. This will allow you to create your own unique shoe.
Example usage:
self | this object pointer reference |
number_decks | integer number of decks. The default value is 1. Legal range is 1 to 12. The alternate constructor will allow you to pass in an arraay of Cards instead of just a single integer for the number of decks. |
ValueError | If the input parameter number_decks is not a legal integer. |
def pybaccarat.playingcards.Shoe.cut_card_seen | ( | self | ) |
Return has the cut card been seen?
Example usage:
self | this object pointer reference |
def pybaccarat.playingcards.Shoe.cut_card_seen | ( | self | ) |
Return has the cut card been seen?
Example usage:
self | this object pointer reference |
def pybaccarat.playingcards.Shoe.deal | ( | self | ) |
Example usage:
self | this object pointer reference |
def pybaccarat.playingcards.Shoe.deal | ( | self | ) |
Example usage:
self | this object pointer reference |
def pybaccarat.playingcards.Shoe.discard_adjust_baccarat | ( | self, | |
type | |||
) |
The discard pile is our shoe prior to the next_card index.
Some games will discard the used cards in a specific manor (i.e. Baccarat). They do that so that when a player complains about the last hand after the dealer has swept the cards away, the pit card back the cards out of the discard pile to show the prior hands.
2P2B: deal: p1 b1 p2 b2 = -4 -3 -2 -1 ^-----—^ swap -4 -1 ^–^ swap -2 -1 sweep: b2 b1 p1 p2(top) 3P2B: deal: p1 b1 p2 b2 p3 ^-----—^ swap -5 -2 ^–^ swap -3 -2 sweep: b2 b1 p1 p2 p3(top) 2P3B: deal: p1 b1 p2 b2 b3 ^--------—^ swap -5 -1 ^--—^ swap -4 -2 ^–^ swap -3 -2 ^–^ swap -2 -1 sweep: b3 b2 b1 p1 p2(top) 3P3B: deal: p1 b1 p2 b2 p3 b3 ^-----------—^ swap -6 -1 ^--—^ swap -5 -3 ^–^ swap -4 -3 ^--—^ swap -3 -1 ^–^ swap -2 -1 sweep: b3 b2 b1 p1 p2 p3(top)
def pybaccarat.playingcards.Shoe.discard_adjust_baccarat | ( | self, | |
type | |||
) |
The discard pile is our shoe prior to the next_card index.
Some games will discard the used cards in a specific manor (i.e. Baccarat). They do that so that when a player complains about the last hand after the dealer has swept the cards away, the pit card back the cards out of the discard pile to show the prior hands.
2P2B: deal: p1 b1 p2 b2 = -4 -3 -2 -1 ^-----—^ swap -4 -1 ^–^ swap -2 -1 sweep: b2 b1 p1 p2(top) 3P2B: deal: p1 b1 p2 b2 p3 ^-----—^ swap -5 -2 ^–^ swap -3 -2 sweep: b2 b1 p1 p2 p3(top) 2P3B: deal: p1 b1 p2 b2 b3 ^--------—^ swap -5 -1 ^--—^ swap -4 -2 ^–^ swap -3 -2 ^–^ swap -2 -1 sweep: b3 b2 b1 p1 p2(top) 3P3B: deal: p1 b1 p2 b2 p3 b3 ^-----------—^ swap -6 -1 ^--—^ swap -5 -3 ^–^ swap -4 -3 ^--—^ swap -3 -1 ^–^ swap -2 -1 sweep: b3 b2 b1 p1 p2 p3(top)
def pybaccarat.playingcards.Shoe.reset | ( | self | ) |
Reset the shoe to start a new shoe.
This method will not shuffle the cards nor assign the cut card position.
self | this object pointer reference |
def pybaccarat.playingcards.Shoe.reset | ( | self | ) |
Reset the shoe to start a new shoe.
This method will not shuffle the cards nor assign the cut card position.
self | this object pointer reference |
def pybaccarat.playingcards.Shoe.set_cut_card | ( | self, | |
position | |||
) |
Assign the cut card position in the shoe.
Example usage:
self | this object pointer reference |
position | integer index position within the shoe. 0 means at the very start of the shoe. A position of 0 would mean that even before the first card has been dealt the cut card has been seen. The max value is the length of the shoe (the very end). For a 6 deck shoe that would mean a maximum value of 312 (6 times 52). A cut card position at the very end of the shoe would mean the cut card would never be seen. A negative value is allowed and means position from the end of the shoe. So a value of -14 would mean count 14 from the end of the shoe. |
ValueError | If the input parameter position is not a legal integer value, then throw a ValueError exception. |
def pybaccarat.playingcards.Shoe.set_cut_card | ( | self, | |
position | |||
) |
Assign the cut card position in the shoe.
Example usage:
self | this object pointer reference |
position | integer index position within the shoe. 0 means at the very start of the shoe. A position of 0 would mean that even before the first card has been dealt the cut card has been seen. The max value is the length of the shoe (the very end). For a 6 deck shoe that would mean a maximum value of 312 (6 times 52). A cut card position at the very end of the shoe would mean the cut card would never be seen. A negative value is allowed and means position from the end of the shoe. So a value of -14 would mean count 14 from the end of the shoe. |
ValueError | If the input parameter position is not a legal integer value, then throw a ValueError exception. |
def pybaccarat.playingcards.Shoe.shuffle | ( | self | ) |
Shuffle cards in the shoe.
Uses the standard Python random package shuffle method.
Example usage:
self | this object pointer reference |
def pybaccarat.playingcards.Shoe.shuffle | ( | self | ) |
Shuffle cards in the shoe.
Uses the standard Python random package shuffle method.
Example usage:
self | this object pointer reference |