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:
parent
f8bd727cbb
commit
a22248a2a5
5
src/g.py
5
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 *)
|
# 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)
|
||||||
|
@ -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='')
|
||||||
|
Loading…
Reference in New Issue
Block a user