From a22248a2a5115a6e0cda0888fe8bbec5fa6acac8 Mon Sep 17 00:00:00 2001 From: Jeeb Date: Wed, 16 Feb 2022 02:39:59 -0600 Subject: [PATCH] fix some bugs ui: Keep track of size (why else pass it in?) g: minor cleanup, print share information AFTER game space! --- src/g.py | 5 ++--- src/ui.py | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/g.py b/src/g.py index 6905365..2236769 100644 --- a/src/g.py +++ b/src/g.py @@ -46,7 +46,7 @@ parser.add_argument('--clear', action='store_true', help="clear screen # TODO: Implement hard mode properly (more than just a *) # Parse the args -args = parser.parse_args()\ +args = parser.parse_args() # Handle the args # Select the correct word list @@ -68,7 +68,6 @@ if args.l: if l in w.Answers and w.Answers.index(l) < d: print ("Wordle {}: {}".format(w.Answers.index(l), l)) else: - print ("{} is not a Wordle (yet?)".format(args.l)) exit(0) # d is for "Find this day's answer" @@ -215,7 +214,7 @@ def win(won): for gi in guesses: board += "\n" + wordbox(gi) - print(ui.m(0,12) + board) + print(ui.m(0,ui.size[1]+1) + board) ui.init(15,12) diff --git a/src/ui.py b/src/ui.py index b95b8ba..e985678 100644 --- a/src/ui.py +++ b/src/ui.py @@ -28,8 +28,11 @@ DOWN = SOUTH = 'B' RIGHT = EAST = 'C' LEFT = WEST = 'D' +size = [0,0] + def init(width, height): + size[0], size[1] = width, height print(c.c24(0x00f0d0) + '0123456789ABCDE' + c.RESET) print(("A"*width + "\n")*(height-1)) print(m(0,-height-1) + ANSI_S, end='')