From 452fa0da3942da5ecdd78aa978923eef87ca6ed6 Mon Sep 17 00:00:00 2001 From: Floris van Doorn Date: Fri, 3 Apr 2020 20:19:28 -0400 Subject: [PATCH] tiny changes to output files --- hanabi_wrapper.py | 5 +++-- play_hanabi.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hanabi_wrapper.py b/hanabi_wrapper.py index dd651ec..306ba2c 100755 --- a/hanabi_wrapper.py +++ b/hanabi_wrapper.py @@ -168,14 +168,15 @@ def std_err(lst): break prevscore = int(next_line) if curscore < prevscore: - logger.info('round {} worsened from {} to {}:'.format(str(num).rjust(nrounds_stringlength), prevscore, curscore)) + logger.info('round {} worsened from {} to {}.'.format(str(num).rjust(nrounds_stringlength), prevscore, curscore)) if curscore > prevscore: - logger.info('round {} improved from {} to {}:'.format(str(num).rjust(nrounds_stringlength), prevscore, curscore)) + logger.info('round {} improved from {} to {}.'.format(str(num).rjust(nrounds_stringlength), prevscore, curscore)) else: with io.open('scores.txt', 'a', encoding='utf-8') as f: for s in scores: f.write(str(s)) f.write('\n') + logger.info('scores written to scores.txt') elif args.verbosity == 'silent': # Still print score for silent single round logger.info('Score: ' + str(scores[0])) diff --git a/play_hanabi.py b/play_hanabi.py index e40b3be..7830348 100644 --- a/play_hanabi.py +++ b/play_hanabi.py @@ -67,7 +67,7 @@ def play_one_round(gameType, players, names, verbosity, lossScore, isPoliced, wr output = { "actions": actions, "deck": startDeck, "notes": notes, "players": players, "variant": variant } with io.open('log.json', 'a', encoding='utf-8') as f: f.write(json.dumps(output, ensure_ascii=False)) - f.write('\n\n') + f.write('\n') for i in range(len(players)): for c in range(total_cards(gameType)): debug[('note', i, c)] = ''