From 119b9bd3dd2b9abde49a7d8b5993e4a9ca55b594 Mon Sep 17 00:00:00 2001 From: xereeto Date: Sat, 9 Mar 2024 18:06:42 +0000 Subject: [PATCH] Update wordle.py added score at end --- wordle.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/wordle.py b/wordle.py index 1a5eb11..5880442 100644 --- a/wordle.py +++ b/wordle.py @@ -208,14 +208,25 @@ def main(): midnight = (datetime.datetime.now() + datetime.timedelta(days=1)).replace(hour=0, minute=0, microsecond=0, second=0) w.updateError("Next WORDLE in: "+str(datetime.timedelta(seconds=(midnight-datetime.datetime.now()).seconds))) time.sleep(2) + return w - +import sys try: - main() + w=main() except KeyboardInterrupt: pass finally: - print("\033c"+reset+"Goodbye!\x1b[?25h") + print("\033cGoodbye!"+reset,end='') + cliflag = sys.argv[1] if len(sys.argv) > 1 else '' + if(cliflag != "--nounicode"): + print("\n\nWordle "+str(w.turn)+"/6") + blocks=["⬛","🟨","🟩"] + for guess in w.guesses: + if guess[0][0]: + for letter in guess[0]: + put(blocks[letter-1]) + print() + print("\x1b[?25h")