since you say that it returns a char value, I'm assuming that i need to run those if statements outside the function?
I've tried it but i guess this isn't in the right order?
Code:
scanf(" %c", &let2bg);
usedcharacters (usedchars, let2bg);
if (usedchars != '\0')
{
checkchar(let2bg, word2bguessed, usercorrect);
printf("\n%s\n", usercorrect);
correctguess = numberright (currentright, usercorrect);
if (correctguess == 0)
{
printf ("You have no correct letters");
}
if ((correctguess < wordlength) && (correctguess > 0))
{
printf ("You have %d correct letters", correctguess);
}
if (correctguess == wordlength)
{
printf ("You win! The correct word was %s!\n", word2bguessed);
return 0;
} /*ends the program*/
}
if (usedchars == '\0')
{printf ("Oops! you tried this letter before. Please enter another letter.");}
}
if (let2bg == '*')
{
printf("thanks for playing!\n");
}
printf ("\nSorry but you've had too many gueses, better luck next time!\n");
return 0;
}