From 9b82335af1f1ff6bdad33437b7db5504d80fd8e3 Mon Sep 17 00:00:00 2001 From: xereeto Date: Sat, 9 Mar 2024 18:06:58 +0000 Subject: [PATCH] Pring black screen first in case terminal is white --- wordle.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/wordle.py b/wordle.py index 5d5bcd0..2ca39be 100644 --- a/wordle.py +++ b/wordle.py @@ -18,7 +18,7 @@ class Wordle: turn=self.turn self.guesses[turn][0]=[4,4,4,4,4] self.drawGuessLine(turn) - time.sleep(0.05) + time.sleep(0.01) self.guesses[turn][1] = word processed=[] for i,letter in enumerate(word): @@ -128,10 +128,14 @@ def putCursorInside(guess,letter): col = 48 + letter * 6; placeCursor(col,row); put(colors[0]) - +def blankScreen(): + placeCursor(0,0) + put(reset+((" "*80+"\n")*24)); + placeCursor(0,0) def main(): cursorLocation = 0 - print(reset+"\033c") + print("\033c") + blankScreen() screen="\x1b[?25l"+fg('green')+''' ████████████████████████████████████████ █▄─█▀▀▀█─▄█─▄▄─█▄─▄▄▀█▄─▄▄▀█▄─▄███▄─▄▄─█ @@ -234,3 +238,4 @@ finally: put(blocks[letter-1]) print() print("\x1b[?25h") +