While Loop Query - code displayed
Hi,
Anybody know why the code within the while loop won't function correctly? I basically want the user to enter letters until they run out of lives. But it keeps printing the text incorretly and not returning the correct answers.
Code:
while (lives !=0)
{
printf("\n\nPlease select a letter: ");
scanf("%c", &letter);
for (x=0; x < number; x++)
{
this_guess == 0;
if (letter == gameword[x])
{
guessedword[x] = letter;
printf("Well done, you have chosen a correct letter: %s\n", guessedword);
this_guess[x] = 1;
}
if (this_guess[x] == 0)
{
printf("incorrect guess");
lives--;
}
}
}
Thanks