Skip to content

Commit

Permalink
Bug: map is now being written on the file, instead of just printed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuno-Jesus committed Mar 18, 2023
1 parent 7628976 commit 96820b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions srcs/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "")
Expand All @@ -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__" :
Expand Down

0 comments on commit 96820b3

Please sign in to comment.