added simpler ascii art for unsupported terminals
This commit is contained in:
parent
ccb6fe33c4
commit
13d852d504
21
wordle.py
21
wordle.py
|
@ -4,6 +4,11 @@ import datetime
|
||||||
import time
|
import time
|
||||||
from getch import getch
|
from getch import getch
|
||||||
import possible
|
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")]
|
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")]
|
keycolors = [fg("white")+bg("black"), fg("dark_gray")+bg("black"),fg("light_yellow")+bg("black"),fg("green")+bg("black")]
|
||||||
|
@ -140,13 +145,21 @@ def main():
|
||||||
cursorLocation = 0
|
cursorLocation = 0
|
||||||
print("\033c")
|
print("\033c")
|
||||||
blankScreen()
|
blankScreen()
|
||||||
|
if not unicode:
|
||||||
|
screen="\x1b[?25l"+fg('green')+''' _ _
|
||||||
|
__ _____ _ __ __| | | ___
|
||||||
|
\ \ /\ / / _ \| '__/ _` | |/ _ \
|
||||||
|
\ V V / (_) | | | (_| | | __/
|
||||||
|
\_/\_/ \___/|_| \__,_|_|\___| '''
|
||||||
|
else:
|
||||||
screen="\x1b[?25l"+fg('green')+'''
|
screen="\x1b[?25l"+fg('green')+'''
|
||||||
████████████████████████████████████████
|
████████████████████████████████████████
|
||||||
█▄─█▀▀▀█─▄█─▄▄─█▄─▄▄▀█▄─▄▄▀█▄─▄███▄─▄▄─█
|
█▄─█▀▀▀█─▄█─▄▄─█▄─▄▄▀█▄─▄▄▀█▄─▄███▄─▄▄─█
|
||||||
██─█─█─█─██─██─██─▄─▄██─██─██─██▀██─▄█▀█
|
██─█─█─█─██─██─██─▄─▄██─██─██─██▀██─▄█▀█
|
||||||
▀▀▄▄▄▀▄▄▄▀▀▄▄▄▄▀▄▄▀▄▄▀▄▄▄▄▀▀▄▄▄▄▄▀▄▄▄▄▄▀
|
▀▀▄▄▄▀▄▄▄▀▀▄▄▄▄▀▄▄▀▄▄▀▄▄▄▄▀▀▄▄▄▄▄▀▄▄▄▄▄▀'''
|
||||||
|
screen +='''
|
||||||
clone by xereeto
|
clone by xereeto
|
||||||
original by josh wardle'''+fg('white')+'''
|
original by josh wardle '''+fg('white')+'''
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
Guess the WORDLE in 6 tries.
|
Guess the WORDLE in 6 tries.
|
||||||
Each guess must be a valid 5 letter word.
|
Each guess must be a valid 5 letter word.
|
||||||
|
@ -163,6 +176,7 @@ def main():
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
Game: XXX
|
Game: XXX
|
||||||
'''
|
'''
|
||||||
|
|
||||||
goHome()
|
goHome()
|
||||||
print(screen,end="")
|
print(screen,end="")
|
||||||
goHome()
|
goHome()
|
||||||
|
@ -233,7 +247,7 @@ except KeyboardInterrupt:
|
||||||
finally:
|
finally:
|
||||||
print("\033cGoodbye!"+reset,end='')
|
print("\033cGoodbye!"+reset,end='')
|
||||||
cliflag = sys.argv[1] if len(sys.argv) > 1 else ''
|
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")
|
print("\n\nWordle "+str(w.turn)+"/6")
|
||||||
blocks=["⬛","🟨","🟩"]
|
blocks=["⬛","🟨","🟩"]
|
||||||
for guess in w.guesses:
|
for guess in w.guesses:
|
||||||
|
@ -242,4 +256,3 @@ finally:
|
||||||
put(blocks[letter-1])
|
put(blocks[letter-1])
|
||||||
print()
|
print()
|
||||||
print("\x1b[?25h")
|
print("\x1b[?25h")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue