本文整理汇总了Python中table.Table.play方法的典型用法代码示例。如果您正苦于以下问题:Python Table.play方法的具体用法?Python Table.play怎么用?Python Table.play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类table.Table
的用法示例。
在下文中一共展示了Table.play方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DeclineInsurancePolicy
# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import play [as 别名]
strat,
DeclineInsurancePolicy(),
MinBettingPolicy())
player2.receive_payment(1000)
table = Table()
table.register_player(player)
nRounds = 0
counter = CardCount('HiLoCount')
table.shoe.registerObserver(counter)
def handler(_signum, _frame):
"""Handles Ctrl+C signals"""
print()
print(str(nRounds) + ' rounds played')
print(str(strat1.num_wrong) + ' hands played incorrectly')
sys.exit(0)
signal.signal(signal.SIGTERM, handler)
signal.signal(signal.SIGINT, handler)
try:
while True:
table.play()
print('Count is ' + str(counter.count))
print()
nRounds += 1
except InsufficientFundsError as e:
print(e)
handler(None, None)
示例2: main
# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import play [as 别名]
def main():
mytable = Table(num_ai_players=3, verbose=2)
mytable.play()
mytable.score()