Beispiel #1
0
def split_hand():
    return BlackjackHand(
        [
            Card(CardValue.Eight, CardSuit.Spades),
            Card(CardValue.Eight, CardSuit.Clubs)
        ],
        7,
    )
Beispiel #2
0
def hard_hand():
    return BlackjackHand(
        [
            Card(CardValue.King, CardSuit.Spades),
            Card(CardValue.Six, CardSuit.Spades)
        ],
        13,
    )
Beispiel #3
0
def busted_hand():
    return BlackjackHand(
        [
            Card(CardValue.King, CardSuit.Spades),
            Card(CardValue.Eight, CardSuit.Clubs),
            Card(CardValue.Queen, CardSuit.Clubs),
        ],
        7,
    )
Beispiel #4
0
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
Beispiel #5
0
 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)
Beispiel #6
0
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
Beispiel #8
0
 def __init__(self):
     self.cards = []
     for val in CardValue.list():
         for suit in CardSuit.list():
             self.cards.append(Card(val, suit))