fix some bugs

ui: Keep track of size (why else pass it in?)

g: minor cleanup, print share information AFTER game space!
This commit is contained in:
John 2022-02-16 02:39:59 -06:00
parent f8bd727cbb
commit a22248a2a5
2 changed files with 5 additions and 3 deletions

View File

@ -46,7 +46,7 @@ parser.add_argument('--clear', action='store_true', help="clear screen
# TODO: Implement hard mode properly (more than just a *) # TODO: Implement hard mode properly (more than just a *)
# Parse the args # Parse the args
args = parser.parse_args()\ args = parser.parse_args()
# Handle the args # Handle the args
# Select the correct word list # Select the correct word list
@ -68,7 +68,6 @@ if args.l:
if l in w.Answers and w.Answers.index(l) < d: if l in w.Answers and w.Answers.index(l) < d:
print ("Wordle {}: {}".format(w.Answers.index(l), l)) print ("Wordle {}: {}".format(w.Answers.index(l), l))
else: else:
print ("{} is not a Wordle (yet?)".format(args.l)) print ("{} is not a Wordle (yet?)".format(args.l))
exit(0) exit(0)
# d is for "Find this day's answer" # d is for "Find this day's answer"
@ -215,7 +214,7 @@ def win(won):
for gi in guesses: for gi in guesses:
board += "\n" + wordbox(gi) board += "\n" + wordbox(gi)
print(ui.m(0,12) + board) print(ui.m(0,ui.size[1]+1) + board)
ui.init(15,12) ui.init(15,12)

View File

@ -28,8 +28,11 @@ DOWN = SOUTH = 'B'
RIGHT = EAST = 'C' RIGHT = EAST = 'C'
LEFT = WEST = 'D' LEFT = WEST = 'D'
size = [0,0]
def init(width, height): def init(width, height):
size[0], size[1] = width, height
print(c.c24(0x00f0d0) + '0123456789ABCDE' + c.RESET) print(c.c24(0x00f0d0) + '0123456789ABCDE' + c.RESET)
print(("A"*width + "\n")*(height-1)) print(("A"*width + "\n")*(height-1))
print(m(0,-height-1) + ANSI_S, end='') print(m(0,-height-1) + ANSI_S, end='')