Zaktualizuj 'Projekt2/hangman.py'

This commit is contained in:
Łukasz Korbanek 2019-03-08 21:31:08 +00:00
parent fb0e297f87
commit 08ce474f13

View File

@ -17,7 +17,7 @@ def get_secret_word(word_file="/usr/share/dict/words"):
return random.choice(good_words)
def get_masked_word(word_file):
mask_word="*" * len(word_file)
mask_word="\033[1;36;40m *" * len(word_file)
return mask_word
def type_guess_word(word_file, guess_word, guessed_line):
@ -28,11 +28,11 @@ def type_guess_word(word_file, guess_word, guessed_line):
guessed_line = guessed_line [0:x] + guess_word + guessed_line[x+1:]
x = x+1
else:
print("\n\033[1;36;40m Pudlo")
print("\n\033[1;31;40m Pudlo")
return guessed_line
def user_input(input=input):
letter = input("Podaje litere:")
letter = input(" Podaje litere:")
return letter