From d83291a0b33168c4bb485dcfaa4c35cac896136d Mon Sep 17 00:00:00 2001 From: Chris Proctor Date: Thu, 13 Jul 2023 08:55:07 -0400 Subject: [PATCH] Log victory in lab --- return_to_ship.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/return_to_ship.py b/return_to_ship.py index b7c196a..bd0990d 100644 --- a/return_to_ship.py +++ b/return_to_ship.py @@ -11,6 +11,7 @@ from datetime import timedelta from fancy_printing import print_fancy CHEST_TIMER_FILE = "adventure/seafloor/coral_reef/.timer" +LOG_FILE = ".log" BEGINNING = [ "Your adventure has only just begun. You are not yet ready to return to the ship. More secrets await you in the ocean's depths. Use `ls` to look around, and use `cd adventure` to start the adventure..." ] @@ -35,6 +36,8 @@ def reset(): def win(): print_fancy(VICTORY) + win_time = datetime.now().isoformat() + Path(LOG_FILE).write_text(f"finished the lab at {win_time}\n") def chest_was_opened(): return Path(CHEST_TIMER_FILE).exists()