Beispiel #1
0
print('Welcome to Black Jack!')

#Ready to play?
ready = input("Ready to play Black Jack? Enter Y or N:").upper()
initial_game = True
if ready == 'Y':
    game_on = True
else:
    game_on = False

while game_on:
    #prepare deck
    new_deck = Deck()

    new_deck.ShuffleDeck()

    #draw initial 2 cards for player and dealer
    if initial_game:
        pl_hand = Player()
        pl_hand.CreateHand(new_deck)
        print(pl_hand)
    else:
        pl_hand.hand = []
        dealer_hand.hand = []
        pl_hand.CreateHand(new_deck)
        print(pl_hand)

    dealer_hand = Dealer(new_deck)
    dealer_hand.CreateHand()
    print(dealer_hand)