store time into one string

This commit is contained in:
2024-04-12 12:49:32 +02:00
parent 3c7946382c
commit c7f224ffb5
+1 -1
View File
@@ -53,7 +53,7 @@ def end(game_state: typing.Dict):
HISTORY_PATH = os.path.join(os.path.dirname(__file__), 'data', 'history') HISTORY_PATH = os.path.join(os.path.dirname(__file__), 'data', 'history')
game_state_storage.add_end_state(game_state["board"], SNAKE.get_history()) game_state_storage.add_end_state(game_state["board"], SNAKE.get_history())
game_state_storage.save(os.path.join(HISTORY_PATH, f"{SNAKE.__class__.__name__}_{datetime.now().strftime('%d.%m.%Y_%H:%M:%S')}_{game_state['game']['id']}.json"), callback=json.dump, indent=2, ensure_ascii=False) game_state_storage.save(os.path.join(HISTORY_PATH, f"{SNAKE.__class__.__name__}_{datetime.now().strftime('%d.%m.%Y_%H%M%S')}_{game_state['game']['id']}.json"), callback=json.dump, indent=2, ensure_ascii=False)
print("GAME OVER\n") print("GAME OVER\n")