if (Guess.Len() != HiddenWord.Len())
{
PrintLine(TEXT("The hidden word is %i letters long"), HiddenWord.Len());
PrintLine(TEXT("Wrong number of characters,\ntry guessing again.\nYou have %i lives remaining."), Lives);
return;
}
// Check Is Isogram
//if (!IsIsogram)
//{
// PrintLine(TEXT("No repeating letters! Guess again."));
// return;
//}
if (Guess == HiddenWord)
{
ClearScreen();
PrintLine(TEXT("You have Won!"));
EndGame();
return;
}
In my opinion the ordred of checks should be:
- Check if guess has right number of characters. We doing this first because there can be an isogram with inappropriate number of characters.
- Check if isogram.
- Check if guess is correct after we know it is an proper length isogram.