Skip to content

Commit

Permalink
tiny changes to output files
Browse files Browse the repository at this point in the history
  • Loading branch information
fpvandoorn committed Apr 4, 2020
1 parent 01ed6c6 commit 452fa0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions hanabi_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]))

Expand Down
2 changes: 1 addition & 1 deletion play_hanabi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)] = ''
Expand Down

0 comments on commit 452fa0d

Please sign in to comment.