fixed unicode characters
This commit is contained in:
@@ -16,7 +16,7 @@ TIMER_SECONDS = 30 # how long the timer runs
|
||||
|
||||
# ---------- HELPERS ----------
|
||||
def load_words(path=WORDS_FILE):
|
||||
"""Return a list of non‑empty stripped lines from the given file."""
|
||||
"""Return a list of non-empty stripped lines from the given file."""
|
||||
try:
|
||||
with open(path, "r", encoding="utf-8") as f:
|
||||
words = [line.strip() for line in f if line.strip()]
|
||||
@@ -70,22 +70,22 @@ def main():
|
||||
words = load_words()
|
||||
timer_thread = None
|
||||
|
||||
print("=== Catchphrase ===")
|
||||
print("=== Catchphrase, but Better ===")
|
||||
print("Commands:")
|
||||
print(" start – begin the 30‑second timer and show a word immediately")
|
||||
print(" next – show another random word while the timer is running")
|
||||
print(" stop – cancel the timer early")
|
||||
print(" exit / quit – leave the program")
|
||||
print(" start - begin the 30-second timer and show a word immediately")
|
||||
print(" next - show another random word while the timer is running")
|
||||
print(" stop - cancel the timer early")
|
||||
print(" exit / quit - leave the program")
|
||||
|
||||
# Helper that prints when the timer ends
|
||||
def announce_finish():
|
||||
print("\n⏰ Time’s up! Returning to menu.")
|
||||
print("\n⏰ Time is up! Returning to menu.")
|
||||
print("=== Catchphrase ===")
|
||||
print("Commands:")
|
||||
print(" start – begin the 30‑second timer and show a word immediately")
|
||||
print(" next – show another random word while the timer is running")
|
||||
print(" stop – cancel the timer early")
|
||||
print(" exit / quit – leave the program")
|
||||
print(" start - begin the 30-second timer and show a word immediately")
|
||||
print(" next - show another random word while the timer is running")
|
||||
print(" stop - cancel the timer early")
|
||||
print(" exit / quit - leave the program")
|
||||
|
||||
while True:
|
||||
try:
|
||||
@@ -111,11 +111,11 @@ def main():
|
||||
|
||||
# Show the first word right away
|
||||
print(pick_random(words))
|
||||
print(f"[+] 30‑second timer started. ({TIMER_SECONDS}s)")
|
||||
print(f"[+] 30-second timer started. ({TIMER_SECONDS}s)")
|
||||
|
||||
elif cmd == "next":
|
||||
if not (timer_thread and timer_thread.is_running):
|
||||
print("[!] No active timer – use 'start' first.")
|
||||
print("[!] No active timer - use 'start' first.")
|
||||
else:
|
||||
print(pick_random(words))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user