finish hint giving, add better logs

This commit is contained in:
2021-03-24 17:37:22 +01:00
parent 542860fede
commit 678d59f856
3 changed files with 44 additions and 15 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ class Game:
def log_to_file(self, filename): # raise OSError when file can't be opened
"""Log the current game state and logs into a YAML file."""
with open(filename, 'w') as f:
with open(filename, 'a') as f:
yaml.dump(self, f)
# # # METHODS THAT OUTPUT INTO STDOUT # # #
+5 -1
View File
@@ -32,4 +32,8 @@ class HintGiver:
def is_hint_name(self, level, branch, hint_name):
if hint_name in self.hints[level][level+branch]:
return True
return False
return False
def log_to_file(self, filename):
with open(filename, 'a') as f:
yaml.dump(self, f)