From 92f8e124bf9380fbc6c491b4a10654ba27c3c3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Mon, 20 Nov 2023 17:01:07 +0100 Subject: [PATCH] add results of bot games to table --- get_sheet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/get_sheet.py b/get_sheet.py index bd228ad..46c50af 100644 --- a/get_sheet.py +++ b/get_sheet.py @@ -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)