Not sure what you are trying to do in this program, but it this meant to exclude letters a-z because that's what it is doing. It will never execute the if block if the word_player[i] is between 'a' and 'z'
char word_validation (char word_player[],int word_size)
{
if (word_size < 3)
{
printf("Word has less than 3 letters.\n");
printf("Enter a valid length word.\n");
return('n');
}
char valid_word = 'y';
for (int i = 0; i < word_size && valid_word == 'y'; ++i)
{
if (word_player[i] < 'a' || word_player[i] > 'z')
valid_word = 'n';
}
if (valid_word != 'y')
{
printf("Invalid Character.\n");
printf("Enter only letters.\n");
}
return(valid_word);
}
I'm not exactly sure how letter_used and guessed are supposed to work. Assuming that letter_used has a maximum length of 26 (there are only 26 letters in the english alphabet) and guessed represents how many guesses have been made, I would rewrite your second function like this: