1
0
Fork 0

small changes

This commit is contained in:
Lili (Tlapka) 2021-03-30 16:31:24 +02:00
parent b1ca5ed09b
commit ae8fe829d7
2 changed files with 2 additions and 2 deletions

View File

@ -52,4 +52,4 @@ class HintGiver:
def log_to_file(self, filename): def log_to_file(self, filename):
"""Write taken hints to a file.""" """Write taken hints to a file."""
with open(filename, 'a') as f: with open(filename, 'a') as f:
yaml.dump(self, f) yaml.dump(self.hints_taken, f)

View File

@ -100,7 +100,7 @@ def give_hint(game, hint_giver):
print("Hints taken in current level:") print("Hints taken in current level:")
for hint in hint_giver.show_taken_hints("level" + str(game.level), game.branch): for hint in hint_giver.show_taken_hints("level" + str(game.level), game.branch):
print("{}: {}".format(hint, hint_giver.take_hint("level" + str(game.level), game.branch, hint))) print("{}: {}".format(hint, hint_giver.take_hint("level" + str(game.level), game.branch, hint)))
print("Choose which hint to take:") print("Choose which hint to take (Write a number):")
print("0: (cancel, take no hint)") print("0: (cancel, take no hint)")
i = 1 i = 1
possible_hints = hint_giver.show_possible_hints("level" + str(game.level), game.branch) possible_hints = hint_giver.show_possible_hints("level" + str(game.level), game.branch)