forked from siengrain/wordleTest
Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Pulguer Gonzalo | 03ac6f32e1 | |
Pulguer Gonzalo | 5a37144d0b | |
Pulguer Gonzalo | f8c8637dfa | |
siengrain | ea560a4852 |
|
@ -0,0 +1,20 @@
|
||||||
|
from PyDictionary import PyDictionary
|
||||||
|
|
||||||
|
dictionary = PyDictionary()
|
||||||
|
|
||||||
|
filler = ["'", '{', '}', '[', ']']
|
||||||
|
|
||||||
|
d = {
|
||||||
|
'test': 'nice'
|
||||||
|
}
|
||||||
|
|
||||||
|
def means(word):
|
||||||
|
if type(d) is type(dictionary.meaning(word)):
|
||||||
|
meaning = str(dictionary.meaning(word))
|
||||||
|
for x in filler:
|
||||||
|
meaning = meaning.replace(x, '')
|
||||||
|
msg = word + ' meaning:\n' + meaning
|
||||||
|
return msg
|
||||||
|
else:
|
||||||
|
return 'made up word it doesnt exist i guess'
|
||||||
|
|
|
@ -14,16 +14,20 @@ def getw():
|
||||||
return palabra
|
return palabra
|
||||||
|
|
||||||
def word(palabra):
|
def word(palabra):
|
||||||
|
used_char = []
|
||||||
hp = 5
|
hp = 5
|
||||||
while hp != 0:
|
while hp != 0:
|
||||||
print('Enter a 5-letter word: ')
|
print('Enter a 5-letter word: ')
|
||||||
guess = input()
|
guess = input()
|
||||||
|
print('\n')
|
||||||
guess = guess.lower()
|
guess = guess.lower()
|
||||||
if len(guess) != 5:
|
if len(guess) != 5:
|
||||||
print('That word has ' + str(len(guess)) + ' letters instead of 5!\n')
|
print('That word has ' + str(len(guess)) + ' letters instead of 5!\n')
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
for x in guess:
|
for x in guess:
|
||||||
|
if x not in used_char:
|
||||||
|
used_char.append(x)
|
||||||
if x not in palabra:
|
if x not in palabra:
|
||||||
guess = guess.replace(x, '_')
|
guess = guess.replace(x, '_')
|
||||||
i = 0
|
i = 0
|
||||||
|
@ -36,6 +40,11 @@ def word(palabra):
|
||||||
i += 1
|
i += 1
|
||||||
print(guess)
|
print(guess)
|
||||||
hp -= 1
|
hp -= 1
|
||||||
|
msg = '\nUsed characters: ' + str(used_char) + '\n'
|
||||||
|
msg = msg.replace('[', '')
|
||||||
|
msg = msg.replace(']', '')
|
||||||
|
msg = msg.replace("'", '')
|
||||||
|
print(msg)
|
||||||
if hp == 0:
|
if hp == 0:
|
||||||
print('u lost! the word was ' + palabra + ' :(')
|
print('u lost! the word was ' + palabra + ' :(')
|
||||||
hint = '_ _ _ _ _'
|
hint = '_ _ _ _ _'
|
||||||
|
|
Loading…
Reference in New Issue