本文整理汇总了Python中hand.Hand.remove方法的典型用法代码示例。如果您正苦于以下问题:Python Hand.remove方法的具体用法?Python Hand.remove怎么用?Python Hand.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hand.Hand
的用法示例。
在下文中一共展示了Hand.remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print_state
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import remove [as 别名]
if num_games == 1:
print_state(False)
# Iterate through each player's turn
for player in players:
# If player busted/passed don't process
if not player.live:
continue
# Process player action (hit or pass)
max_val = get_max()
# Hit
if player.hit(max_val, live_players / len(players)):
# Draw card
card = deck.cards[0]
deck.remove(card)
player.draw_card(card)
if num_games == 1:
print("{0} draws a {1}".format(player.name, card))
# Check for bust
if not player.live:
live_players -= 1
player.busted = True
if num_games == 1:
print("{0} busts with a score of {1}\n".format(player.name, player.score))
# Pass
else:
if num_games == 1:
print("{0} passes".format(player.name))
player.live = False