From 96820b3dc2257f757aae8215d9031c4e20eccb1f Mon Sep 17 00:00:00 2001 From: Nuno Jesus Date: Sat, 18 Mar 2023 02:17:53 +0000 Subject: [PATCH] Bug: map is now being written on the file, instead of just printed. --- srcs/generator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/srcs/generator.py b/srcs/generator.py index 2f474c4..971bd71 100644 --- a/srcs/generator.py +++ b/srcs/generator.py @@ -89,6 +89,7 @@ def generate_map(filename, x, y) -> None: f = open(filename, "x") for line in contents: + f.write("".join(line) + '\n') for char in line: if char is WALL: print(f'{LBLUE}{char}{RESET}', end = "") @@ -101,6 +102,7 @@ def generate_map(filename, x, y) -> None: else: print(char, end = "") print() + f.close() print(f'\n\t --- The map was saved in {LRED}{filename}{RESET}. ---\n') if __name__ == "__main__" :