Você está na página 1de 1

d=int(input("Quantos erros: "))

c=0
def forca(x=0):
if x==0:
print("Erros:0")
else:
while d!=c:
c+=1
if x!=c and x!=d:
print("Erros:", c) #problema aqui
print("GAME OVER!")
print("Erraste", d, " vezes!")

erros=0

word=input("Informe a palavra: ");


temp=[]
for letra in word:
temp.append('_')

while True:
print('\n'*20)

print("Palavra:", end='')
for let in temp:
print(let, end=' ')
print('\n'*2)

if erros==d:
break

ganhouJogo=True
for let in temp:
if let=='_':
ganhouJogo=False
if ganhouJogo:
print("PARABÉNS VENCEDOR!!!")
break

letraDig=input("Informe uma letra: ")


errouLetra=True
for i, let in enumerate(word):
if word[i]==letraDig:
temp[i]=word[i]
errouLetra=False
if errouLetra:
erros=erros+1

Você também pode gostar