I initially had put two “for” loops inside of the ProcessGuess function. Would it be completely wrong, or is this just a matter of better readability and for this game’s particular design?
**Note that it’s currently commented out.
void UBullCowCartridge::ProcessGuess(FString Guess)
{
if (Guess == HiddenWord)
{
PrintLine (TEXT("You win!"));
//+ difficulty
//On max difficulty: PlayAgain or Quit
EndGame();
return;
}
if (Guess.Len() != HiddenWord.Len())
{
PrintLine(TEXT("It's %i letters long, dummy... \nTry again!"), HiddenWord.Len());
PrintLine(TEXT("You still have %i lives left."), Lives);
return;
}
if(!IsIsogram(Guess))
{
PrintLine(TEXT("Can't have repeating letters, guess again"));
}
// If it doesn't meet requirement, GuessAgain
// else
// {
// for (int32 HW = 0; HW < HiddenWord.Len(); HW++)
// {
// PrintLine(TEXT("%c"), HiddenWord[HW]);
// // PrintLine(TEXT("%c"), Guess[HW]);
// }
// for (int32 IP = 0; IP < Guess.Len(); IP++)
// {
// PrintLine(TEXT("%c"), Guess[IP]);
// }
// }