コード例 #1
0
ファイル: play.py プロジェクト: ThatClyde/Simple_BlackJack
            input("How many packs of cards should make up your deck? [1-10] "))
        if packs < 0:
            raise ValueError()
        break
    except ValueError:
        print("{} is not a valid number of packs. They will throw you out of Vegas for that kinda crap".format(packs))
deck = Deck(packs)
deck.shuffle()

# Setting the play variable and the game counter
play_another = 'y'
while play_another != 'n':
    # clear screen between rounds
    clearscreen()

    if (deck.cards_left() < 10):
        print(
            "There were only {} cards left in the deck, so the dealer reshuffled.".format(
                deck.cards_left()))
        deck = Deck(packs)
        deck.shuffle()
    player_hand = Hand()
    dealer_hand = Hand()
    # listing the players's stats
    print("{}'s current chipcount: ${} - {}'s starting amount: ${}.".format(player.name,
                                                                            round(player.money, 2), player.name, round(player.start_money, 2)))
    print("{} Hands played. {} Hands won. Win percentage: {}%".format(
        player.games_played, player.wins, player.win_percentage))
    if player.money < 1:
        break
    else: