From dc532c1fdd63cf5302a74cb88fbbbd4f93065c53 Mon Sep 17 00:00:00 2001 From: Cameron Blankenbuehler Date: Mon, 29 Aug 2022 15:21:46 -0400 Subject: [PATCH] Update board_randomizer.py to generate csv board files --- board_randimizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board_randimizer.py b/board_randimizer.py index f4e765d..d91aba4 100755 --- a/board_randimizer.py +++ b/board_randimizer.py @@ -7,7 +7,7 @@ def read_dice_file(path): # TODO: Factor in 'qu' die face '''Return list of die strings from file ignoring all comments (#)''' with open(path, 'r+', encoding="utf-8") as file: - return [''.join(line.rstrip().split(',')) for line in file.readlines() if line[0] != "#"] + return [line.rstrip().split(',') for line in file.readlines() if line[0] != "#"] def roll_die(die: str): '''Return a face of the given die string to simulate rolling a die''' @@ -28,4 +28,4 @@ if __name__ == '__main__': # Format dice rolls for boards file board_size = int(sqrt(len(rolls))) for i in range(0, len(dice_strings), board_size): - print("".join(rolls[i:i+board_size])) + print(",".join(rolls[i:i+board_size]))