tweak level selector, add quiz, make it work

This commit is contained in:
2021-03-29 20:11:03 +02:00
parent 9673655b44
commit 2a2557f3c6
2 changed files with 61 additions and 9 deletions
+7
View File
@@ -158,6 +158,13 @@ class Game:
self.game_finished = False
self.level = 0
self.branch = ''
def running_time(self):
"""Return running time in minutes."""
current_time = time.time()
total_time_seconds = int(current_time - self.game_start_time)
return int(total_time_seconds/60)
# # # METHODS THAT WORK WITH FILES # # #
def read_mapping(self, filename): # raise OSError when file can't be opened
"""Read a mapping of levels for the adaptive game from a YAML file."""