Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ClydeBank Coffee Shop Simulator 4000
# Copyright 2022 (C) ClydeBank Media, All Rights Reserved.
# Proving this works

import pickle
import re
Expand All @@ -15,7 +16,9 @@
run_game = True
if Path(CoffeeShopSimulator.SAVE_FILE).is_file():
# Save game exists, do they want to load it?
response = CoffeeShopSimulator.prompt("There's a saved game. Do you want to load it? (Y/N)", True)
response = CoffeeShopSimulator.prompt(
"There's a saved game. Do you want to load it? (Y/N)", True
)
if re.search("y", response, re.IGNORECASE):
# Load the game and run!
with open(CoffeeShopSimulator.SAVE_FILE, mode="rb") as f:
Expand All @@ -24,12 +27,14 @@
# We don't need to run the game again
run_game = False
else:
print("HINT: If you don't want to see this prompt again, remove the savegame.dat file.\n")
print(
"HINT: If you don't want to see this prompt again, remove the savegame.dat file.\n"
)

if run_game:
# Create the game object and run it!
game = CoffeeShopSimulator()
game.run()

# Say goodbye!
print("\nThanks for playing. Have a great rest of your day!\n")
print("\nThanks for playing. Have a great rest of your day!\n")