本文整理汇总了Python中game.game.Game.pretty_print方法的典型用法代码示例。如果您正苦于以下问题:Python Game.pretty_print方法的具体用法?Python Game.pretty_print怎么用?Python Game.pretty_print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game.game.Game
的用法示例。
在下文中一共展示了Game.pretty_print方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SpinnyStrategy
# 需要导入模块: from game.game import Game [as 别名]
# 或者: from game.game.Game import pretty_print [as 别名]
strategy = None
if args.strategy == "spinny":
strategy = SpinnyStrategy()
elif args.strategy == "random":
strategy = RandomStrategy()
else:
from strategy.nn.nn_strategy import ModelStrategy
strategy = ModelStrategy(args.strategy, verbose_period=5000)
total = 0
for i in range(args.number_of_games):
game = Game()
running = True
while running:
turn_outcome = game.do_turn(
strategy.get_move(game.board(), game.score()))
if args.verbose:
game.pretty_print()
running = (turn_outcome != GAMEOVER)
strategy.notify_outcome(game.board(), game.score())
if not args.summary:
print(game.score())
total += game.score()
if not (i % 25):
print("...", i, "/", args.number_of_games)
if args.summary:
print("Strategy %s had average score %f after %d games" %
(args.strategy,
(total / args.number_of_games), args.number_of_games))