def startGame(): deck = Deck() deck.shuffle(1000) player = Hand() dealer = Hand() player.drawCard(deck) dealer.drawCard(deck) player.drawCard(deck) dealer.drawCard(deck)
game_state = True while game_state == True: bet = input("How much would you like to bet? ($10 minimum)") if p1.checkBet(bet): p1.removeFunds(bet) print(f"${bet} removed from funds. You have ${p1.bank} left.") print("shuffling the deck...\n") deck = Deck() deck.shuffle(1000) print("dealing the cards...\n") player = Hand() dealer = Hand() player.drawCard(deck) dealer.drawCard(deck) player.drawCard(deck) dealer.drawCard(deck) displayHands() while (game_state == True) and (player.calculateScore() <= 21) and ( dealer.calculateScore() <= 21) and ((player.stay is not True) and (dealer.stay is not True)): dealerMove() playerMove() determineWinner(player, dealer) game_ends()