本文整理汇总了Python中arena.Arena.fight方法的典型用法代码示例。如果您正苦于以下问题:Python Arena.fight方法的具体用法?Python Arena.fight怎么用?Python Arena.fight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arena.Arena
的用法示例。
在下文中一共展示了Arena.fight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from arena import Arena [as 别名]
# 或者: from arena.Arena import fight [as 别名]
def main(botname, player):
competition_io = CompetitionIo()
quiet_interactive_io = QuietInteractiveIo()
prop_bot = getattr(B, botname)(bot_io = competition_io)
opp_bot = B.InteractiveBot(bot_io = quiet_interactive_io)
if player == 0:
bot1, bot2 = prop_bot, opp_bot
else:
bot2, bot1 = prop_bot, opp_bot
try:
arena_competition = Arena(arena_io = quiet_interactive_io, bot1 = bot1, bot2 = bot2)
arena_competition.fight()
except EOFError:
pass
示例2: IdleBot
# 需要导入模块: from arena import Arena [as 别名]
# 或者: from arena.Arena import fight [as 别名]
bot2 = IdleBot(bot_io = thunk_io))
#arena_interactive.fight()
# Two randoms duking it out
arena_random = Arena(arena_io = game_io,
bot1 = RandomBot(bot_io = CompositeIo(game_io, WriteReplayIo(fd = rpl_fd))),
bot2 = RandomBot(bot_io = thunk_io))
#arena_random.fight()
# Non-interactive faux strat against idle with replay
strategy_bot_test = StrategyBot(bot_io = CompositeIo(game_io, WriteReplayIo(fd = rpl_fd)))
strategy_bot_test.add_strategy(
SequenceStrategy(
#GenerateValueStrategy(slot = 0, target = 15),
#GenerateValueStrategy(slot = 1, target = 3),
#GenerateValueStrategy(slot = 3, target = 15),
#AppNTo0Strategy(slot = 2, n_slot = 4),
#GetIStrategy(slot = 100, i_slot = 1),
#AppFIJNStrategy(slot = 2, f_card = cards.help, i_num = 3, j_num = 3, n_num = 8192),
#AppFIJNStrategy(slot = 2, f_card = cards.attack, i_num = 3, j_num = 3, n_num = 1024),
DumbSlotKiller(battery_slot = 3, target_slot = 252),
#IdleStrategy(),
))
arena_strategy = Arena(arena_io = game_io,
bot1 = IdleBot(bot_io = thunk_io),
bot2 = strategy_bot_test)
arena_strategy.fight()
game_io.notify_total_time(clock() - start)