add results of bot games to table
This commit is contained in:
parent
beecacb897
commit
92f8e124bf
1 changed files with 3 additions and 2 deletions
|
@ -247,14 +247,15 @@ def create_replay_links(ids: List[int], strategy: str):
|
|||
outfile = Path('out/{}_links.csv'.format(strategy))
|
||||
with open(outfile, 'w') as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(["Game ID", "{} Replay Link".format(strategy)])
|
||||
writer.writerow(["Game ID", "Result", "{} Replay Link".format(strategy)])
|
||||
for game_id in ids:
|
||||
replay = get_game_json(game_id, strategy)
|
||||
instance, actions = parse_json_game(replay)
|
||||
game = HanabLiveGameState(instance)
|
||||
for action in actions:
|
||||
game.make_action(action)
|
||||
writer.writerow([game_id, link(game)])
|
||||
bdrs, termination = describe_game(replay)
|
||||
writer.writerow([game_id, 'Win' if game.is_won() else termination, link(game)])
|
||||
|
||||
x = pandas.read_csv(outfile)
|
||||
x.to_html(outfile.with_suffix('.html'), render_links=True)
|
||||
|
|
Loading…
Reference in a new issue