Changes I guess

This commit is contained in:
John 2022-02-12 11:38:44 -06:00
parent b1acbea3b1
commit 923569a944

View File

@ -57,7 +57,7 @@ else:
if args.word: if args.word:
wotd = args.word wotd = args.word
# Indicate a non-standard word # Indicate a non-standard word
d = -1 d = args.word
else: else:
if d >= len(w.Answers): if d >= len(w.Answers):
d = len(w.Answers) - 1 d = len(w.Answers) - 1
@ -69,37 +69,31 @@ a = ["⬛", "🟨", "🟩"]
# Guesses go here # Guesses go here
g = [] g = []
# Hits/Misses go here
h = ""
m = ""
# C R A N E # C R A N E
hints = [0, 0, 0, 0, 0] hints = [0, 0, 0, 0, 0]
def wordbox(word): def wordbox(word):
b = "" b = ""
global h, m, hints global hints
wordlist = list(wotd) wordlist = list(word)
line = [0] * len(word) line = [0] * len(word)
# Green pass # Green pass
for i in range(len(word)): for i in range(len(word)):
if word[i] == wotd[i]: if word[i] == wotd[i]:
line[i] = 2 line[i] = 2
# Mark as hinted (right place)
hints[i] = 2 hints[i] = 2
wordlist[i] = 0 wordlist[i] = 0
h += word[i]
# Yellow pass # Yellow pass
for i in range(len(word)): for i in range(len(word)):
if wordlist[i] and word[i] in wordlist: if wordlist[i] and word[i] in wotd:
line[i] = 1 line[i] = 1
# Mark as hinted (wrong place) # Mark as hinted (wrong place)
hints[wordlist.index(word[i])]= 1 hints[wordlist.index(word[i])]= 1
# Remove letter from wordlist # Remove letter from wordlist
wordlist[wordlist.index(word[i])] = 0 wordlist[i] = 0
# Mark the hit
h += word[i]
# Blockify pass # Blockify pass
for i in line: for i in line: