def split_hand(): return BlackjackHand( [ Card(CardValue.Eight, CardSuit.Spades), Card(CardValue.Eight, CardSuit.Clubs) ], 7, )
def hard_hand(): return BlackjackHand( [ Card(CardValue.King, CardSuit.Spades), Card(CardValue.Six, CardSuit.Spades) ], 13, )
def busted_hand(): return BlackjackHand( [ Card(CardValue.King, CardSuit.Spades), Card(CardValue.Eight, CardSuit.Clubs), Card(CardValue.Queen, CardSuit.Clubs), ], 7, )
def double_ace_hand(): cards = [] cards.append(Card(CardValue.Two, CardSuit.Spades)) cards.append(Card(CardValue.Ace, CardSuit.Spades)) cards.append(Card(CardValue.Four, CardSuit.Spades)) cards.append(Card(CardValue.Ace, CardSuit.Clubs)) hand = BlackjackHand(cards) return hand
def from_string(cls, comma_seperated_cards: str): card_strings = [x.strip() for x in comma_seperated_cards.split(",")] cards = [] for card_str in card_strings: cards.append(Card.from_string(card_str)) return cls(cards)
def soft_hand(): return BlackjackHand([ Card(CardValue.Ace, CardSuit.Spades), Card(CardValue.Six, CardSuit.Spades) ], 27)
def game(): shoe = Shoe() game = GameDriver(shoe, Player("Test", OptimalStrategy())) game.dealer_card = Card(CardValue.King, CardSuit.Spades) return game
def __init__(self): self.cards = [] for val in CardValue.list(): for suit in CardSuit.list(): self.cards.append(Card(val, suit))