added simpler ascii art for unsupported terminals

This commit is contained in:
xereeto 2024-03-09 18:07:07 +00:00
parent ccb6fe33c4
commit 13d852d504
1 changed files with 19 additions and 6 deletions

View File

@ -4,6 +4,11 @@ import datetime
import time
from getch import getch
import possible
import os
unicode=True
if not 'xterm' in os.environ['TERM']:
unicode=False
colors = [bg("white")+fg("black"), bg("dark_gray")+fg("white"),bg("light_yellow")+fg("dark_gray"),bg("green")+fg("white"),bg("light_gray")]
keycolors = [fg("white")+bg("black"), fg("dark_gray")+bg("black"),fg("light_yellow")+bg("black"),fg("green")+bg("black")]
@ -140,11 +145,19 @@ def main():
cursorLocation = 0
print("\033c")
blankScreen()
if not unicode:
screen="\x1b[?25l"+fg('green')+''' _ _
__ _____ _ __ __| | | ___
\ \ /\ / / _ \| '__/ _` | |/ _ \
\ V V / (_) | | | (_| | | __/
\_/\_/ \___/|_| \__,_|_|\___| '''
else:
screen="\x1b[?25l"+fg('green')+'''
'''
screen +='''
clone by xereeto
original by josh wardle '''+fg('white')+'''
----------------------------------------
@ -163,6 +176,7 @@ def main():
----------------------------------------
Game: XXX
'''
goHome()
print(screen,end="")
goHome()
@ -233,7 +247,7 @@ except KeyboardInterrupt:
finally:
print("\033cGoodbye!"+reset,end='')
cliflag = sys.argv[1] if len(sys.argv) > 1 else ''
if(w and cliflag != "--no-unicode"):
if(w and cliflag != "--no-unicode" and unicode):
print("\n\nWordle "+str(w.turn)+"/6")
blocks=["","🟨","🟩"]
for guess in w.guesses:
@ -242,4 +256,3 @@ finally:
put(blocks[letter-1])
print()
print("\x1b[?25h")