本文整理汇总了Python中models.Player.update_percentage方法的典型用法代码示例。如果您正苦于以下问题:Python Player.update_percentage方法的具体用法?Python Player.update_percentage怎么用?Python Player.update_percentage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Player
的用法示例。
在下文中一共展示了Player.update_percentage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from models import Player [as 别名]
# 或者: from models.Player import update_percentage [as 别名]
print("You were dealt a {}.".format(x))
print("Your score is: {}".format(player_hand.score()))
# dealer logic
print(
"The dealer shows his hand and has {}".format(
dealer_hand.show_cards()))
while((dealer_hand.score() <= 17) and (dealer_hand.score() < player_hand.score()) and (player_hand.score() <= 21)):
x = deck.deal()
dealer_hand.add_card(x)
print("The dealer hits and gets a {}".format(x))
print("His score is {}.".format(dealer_hand.score()))
# win/lose conditions
win_conditions(player, player_hand, dealer_hand)
player.games_played += 1
player.update_percentage()
print("")
play_another = (input("Are you up for another hand? (y/n)").lower())
# Goodbye message/warning.
clearscreen()
if player.money <= 0:
print("Sorry friend, you've got to have money to rent a seat. Have a nice one.")
print(
"Thanks for playing! You're leaving the table win percentage of {}%.".format(
player.win_percentage))
if player.money >= player.start_money:
print(