def three_2s_AK(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Tre), PlayingCard(Suit.Diamonds, FaceValue.Tre), PlayingCard(Suit.Clubs, FaceValue.Tre), PlayingCard(Suit.Spades, FaceValue.Ace), PlayingCard(Suit.Hearts, FaceValue.King) ])
def aces_2s_K(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Ace), PlayingCard(Suit.Diamonds, FaceValue.Ace), PlayingCard(Suit.Spades, FaceValue.Deuce), PlayingCard(Suit.Diamonds, FaceValue.Deuce), PlayingCard(Suit.Spades, FaceValue.King) ])
def flush_h_KQJ98(self): return PokerHand([ PlayingCard(Suit.Hearts, FaceValue.King), PlayingCard(Suit.Hearts, FaceValue.Queen), PlayingCard(Suit.Hearts, FaceValue.Jack), PlayingCard(Suit.Hearts, FaceValue.Nine), PlayingCard(Suit.Hearts, FaceValue.Eight) ])
def flush_s_A7532(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Ace), PlayingCard(Suit.Spades, FaceValue.Seven), PlayingCard(Suit.Spades, FaceValue.Five), PlayingCard(Suit.Spades, FaceValue.Tre), PlayingCard(Suit.Spades, FaceValue.Deuce) ])
def ace_high_straight(self): return PokerHand([ PlayingCard(Suit.Diamonds, FaceValue.Ace), PlayingCard(Suit.Hearts, FaceValue.King), PlayingCard(Suit.Hearts, FaceValue.Queen), PlayingCard(Suit.Hearts, FaceValue.Jack), PlayingCard(Suit.Hearts, FaceValue.Ten) ])
def six_high_straight2(self): return PokerHand([ PlayingCard(Suit.Clubs, FaceValue.Six), PlayingCard(Suit.Hearts, FaceValue.Five), PlayingCard(Suit.Spades, FaceValue.Four), PlayingCard(Suit.Hearts, FaceValue.Tre), PlayingCard(Suit.Hearts, FaceValue.Deuce) ])
def sevens_full_of_aces(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Seven), PlayingCard(Suit.Diamonds, FaceValue.Seven), PlayingCard(Suit.Clubs, FaceValue.Seven), PlayingCard(Suit.Clubs, FaceValue.Ace), PlayingCard(Suit.Diamonds, FaceValue.Ace) ])
def eights_full_of_2s(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Eight), PlayingCard(Suit.Diamonds, FaceValue.Eight), PlayingCard(Suit.Clubs, FaceValue.Eight), PlayingCard(Suit.Spades, FaceValue.Deuce), PlayingCard(Suit.Diamonds, FaceValue.Deuce) ])
def four_4s_9(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Four), PlayingCard(Suit.Diamonds, FaceValue.Four), PlayingCard(Suit.Clubs, FaceValue.Four), PlayingCard(Suit.Hearts, FaceValue.Four), PlayingCard(Suit.Spades, FaceValue.Nine) ])
def four_8s_3(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Eight), PlayingCard(Suit.Diamonds, FaceValue.Eight), PlayingCard(Suit.Clubs, FaceValue.Eight), PlayingCard(Suit.Hearts, FaceValue.Eight), PlayingCard(Suit.Diamonds, FaceValue.Tre) ])
def king_high_straight_flush(self): return PokerHand([ PlayingCard(Suit.Diamonds, FaceValue.King), PlayingCard(Suit.Diamonds, FaceValue.Queen), PlayingCard(Suit.Diamonds, FaceValue.Jack), PlayingCard(Suit.Diamonds, FaceValue.Ten), PlayingCard(Suit.Diamonds, FaceValue.Nine) ])
def Ks_Qs_J(self): return PokerHand([ PlayingCard(Suit.Diamonds, FaceValue.King), PlayingCard(Suit.Clubs, FaceValue.King), PlayingCard(Suit.Spades, FaceValue.Queen), PlayingCard(Suit.Diamonds, FaceValue.Queen), PlayingCard(Suit.Spades, FaceValue.Jack) ])
def tens_9s_8(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Ten), PlayingCard(Suit.Diamonds, FaceValue.Ten), PlayingCard(Suit.Spades, FaceValue.Nine), PlayingCard(Suit.Diamonds, FaceValue.Nine), PlayingCard(Suit.Spades, FaceValue.Eight) ])
def royal_flush_hearts(self): return PokerHand([ PlayingCard(Suit.Hearts, FaceValue.Ace), PlayingCard(Suit.Hearts, FaceValue.King), PlayingCard(Suit.Hearts, FaceValue.Queen), PlayingCard(Suit.Hearts, FaceValue.Jack), PlayingCard(Suit.Hearts, FaceValue.Ten) ])
def tens_9s_8v2(self): return PokerHand([ PlayingCard(Suit.Clubs, FaceValue.Ten), PlayingCard(Suit.Hearts, FaceValue.Ten), PlayingCard(Suit.Clubs, FaceValue.Nine), PlayingCard(Suit.Hearts, FaceValue.Nine), PlayingCard(Suit.Diamonds, FaceValue.Eight) ])
def ace_K_Q_J_8v2(self): return PokerHand([ PlayingCard(Suit.Clubs, FaceValue.Ace), PlayingCard(Suit.Hearts, FaceValue.King), PlayingCard(Suit.Clubs, FaceValue.Queen), PlayingCard(Suit.Clubs, FaceValue.Jack), PlayingCard(Suit.Clubs, FaceValue.Eight) ])
def seven_5_4_3_2(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Seven), PlayingCard(Suit.Spades, FaceValue.Five), PlayingCard(Suit.Diamonds, FaceValue.Four), PlayingCard(Suit.Spades, FaceValue.Tre), PlayingCard(Suit.Spades, FaceValue.Deuce) ])
def ace_k_q_j_9(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Ace), PlayingCard(Suit.Diamonds, FaceValue.King), PlayingCard(Suit.Spades, FaceValue.Queen), PlayingCard(Suit.Spades, FaceValue.Jack), PlayingCard(Suit.Spades, FaceValue.Nine) ])
def ace_K_Q_J_8(self): return PokerHand([ PlayingCard(Suit.Diamonds, FaceValue.Ace), PlayingCard(Suit.Spades, FaceValue.King), PlayingCard(Suit.Diamonds, FaceValue.Queen), PlayingCard(Suit.Diamonds, FaceValue.Jack), PlayingCard(Suit.Spades, FaceValue.Eight) ])
def fives_J_9_6(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Five), PlayingCard(Suit.Diamonds, FaceValue.Five), PlayingCard(Suit.Diamonds, FaceValue.Jack), PlayingCard(Suit.Spades, FaceValue.Nine), PlayingCard(Suit.Diamonds, FaceValue.Six) ])
def twos_K_Q_J(self): return PokerHand([ PlayingCard(Suit.Clubs, FaceValue.Deuce), PlayingCard(Suit.Hearts, FaceValue.Deuce), PlayingCard(Suit.Clubs, FaceValue.King), PlayingCard(Suit.Diamonds, FaceValue.Queen), PlayingCard(Suit.Hearts, FaceValue.Jack) ])
def tens_8_7_6(self): return PokerHand([ PlayingCard(Suit.Clubs, FaceValue.Ten), PlayingCard(Suit.Hearts, FaceValue.Ten), PlayingCard(Suit.Spades, FaceValue.Eight), PlayingCard(Suit.Spades, FaceValue.Seven), PlayingCard(Suit.Spades, FaceValue.Six) ])
def fives_J_9_6v2(self): return PokerHand([ PlayingCard(Suit.Clubs, FaceValue.Five), PlayingCard(Suit.Hearts, FaceValue.Five), PlayingCard(Suit.Clubs, FaceValue.Jack), PlayingCard(Suit.Diamonds, FaceValue.Nine), PlayingCard(Suit.Clubs, FaceValue.Six) ])
def tens_K_3_2(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Ten), PlayingCard(Suit.Diamonds, FaceValue.Ten), PlayingCard(Suit.Diamonds, FaceValue.King), PlayingCard(Suit.Diamonds, FaceValue.Tre), PlayingCard(Suit.Diamonds, FaceValue.Deuce) ])
def aces_4_3_2(self): return PokerHand([ PlayingCard(Suit.Clubs, FaceValue.Ace), PlayingCard(Suit.Hearts, FaceValue.Ace), PlayingCard(Suit.Spades, FaceValue.Four), PlayingCard(Suit.Spades, FaceValue.Tre), PlayingCard(Suit.Spades, FaceValue.Deuce) ])
def fours_3s_K(self): return PokerHand([ PlayingCard(Suit.Spades, FaceValue.Four), PlayingCard(Suit.Diamonds, FaceValue.Four), PlayingCard(Suit.Diamonds, FaceValue.Tre), PlayingCard(Suit.Clubs, FaceValue.Tre), PlayingCard(Suit.Hearts, FaceValue.King) ])
def cards(self): if Deck._cards is None: Deck._cards = [] for face_value in FaceValue: for suit in Suit: Deck._cards.append(PlayingCard(suit, face_value)) return Deck._cards
def loaddeck(self): deck = [ PlayingCard('ace', 'club', '1/11'), PlayingCard('ace', 'diamond', '1/11'), PlayingCard('ace', 'heart', '1/11'), PlayingCard('ace', 'spade', '1/11'), PlayingCard('two', 'club', 2), PlayingCard('two', 'diamond', 2), PlayingCard('two', 'heart', 2), PlayingCard('two', 'spade', 2), PlayingCard('three', 'club', 3), PlayingCard('hree', 'diamond', 3), PlayingCard('three', 'heart', 3), PlayingCard('three', 'spade', 3), PlayingCard('four', 'club', 4), PlayingCard('four', 'diamond', 4), PlayingCard('four', 'heart', 4), PlayingCard('two', 'spade', 4), PlayingCard('five', 'club', 5), PlayingCard('five', 'diamond', 5), PlayingCard('five', 'heart', 5), PlayingCard('five', 'spade', 5), PlayingCard('six', 'club', 6), PlayingCard('six', 'diamond', 6), PlayingCard('six', 'heart', 6), PlayingCard('six', 'spade', 6), PlayingCard('seven', 'club', 7), PlayingCard('seven', 'diamond', 7), PlayingCard('seven', 'heart', 7), PlayingCard('seven', 'spade', 2), PlayingCard('eight', 'club', 8), PlayingCard('eight', 'diamond', 8), PlayingCard('eight', 'heart', 8), PlayingCard('eight', 'spade', 8), PlayingCard('nine', 'club', 9), PlayingCard('nine', 'diamond', 9), PlayingCard('nine', 'heart', 9), PlayingCard('nine', 'spade', 9), PlayingCard('ten', 'club', 10), PlayingCard('ten', 'diamond', 10), PlayingCard('ten', 'heart', 10), PlayingCard('ten', 'spade', 10), PlayingCard('jack', 'club', 10), PlayingCard('jack', 'diamond', 10), PlayingCard('jack', 'heart', 10), PlayingCard('jack', 'spade', 10), PlayingCard('queen', 'club', 10), PlayingCard('queen', 'diamond', 10), PlayingCard('queen', 'heart', 10), PlayingCard('queen', 'spade', 10), PlayingCard('king', 'club', 10), PlayingCard('king', 'diamond', 10), PlayingCard('king', 'heart', 10), PlayingCard('king', 'spade', 10) ] return deck
def __create_deck_(self): return_deck = [] for s in self._suits: for c in self._card: return_deck.append(PlayingCard(s, c)) return return_deck
def __init__(self, n, s, str_image_on, parent): PlayingCard.__init__(self, n, str_image_on, parent) self.__suit = s self.rank = n if n > 10: self.set_point(n - 9.5)