Compare commits

...

4 Commits

Author SHA1 Message Date
Pulguer Gonzalo 03ac6f32e1 dictionary 2022-02-16 10:30:51 -03:00
Pulguer Gonzalo 5a37144d0b Merge remote-tracking branch 'origin/master'
Added used characters
2022-02-05 15:26:11 -03:00
Pulguer Gonzalo f8c8637dfa used characters 2022-02-05 11:51:35 -03:00
siengrain ea560a4852 Merge pull request 'Arreglo de letras repetidas y shebang' (#1) from dendy/wordleTest:master into master
Reviewed-on: https://git.fai.su/siengrain/wordleTest/pulls/1
2022-02-01 12:00:29 +00:00
2 changed files with 29 additions and 0 deletions

20
dictionary.py Normal file
View File

@ -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'

View File

@ -14,16 +14,20 @@ def getw():
return palabra
def word(palabra):
used_char = []
hp = 5
while hp != 0:
print('Enter a 5-letter word: ')
guess = input()
print('\n')
guess = guess.lower()
if len(guess) != 5:
print('That word has ' + str(len(guess)) + ' letters instead of 5!\n')
continue
else:
for x in guess:
if x not in used_char:
used_char.append(x)
if x not in palabra:
guess = guess.replace(x, '_')
i = 0
@ -36,6 +40,11 @@ def word(palabra):
i += 1
print(guess)
hp -= 1
msg = '\nUsed characters: ' + str(used_char) + '\n'
msg = msg.replace('[', '')
msg = msg.replace(']', '')
msg = msg.replace("'", '')
print(msg)
if hp == 0:
print('u lost! the word was ' + palabra + ' :(')
hint = '_ _ _ _ _'