When trying to solve the challenge I came up with the solution I used in the function below. Please let me know what issue will arise if I stick to it.
// receives VALID guess, increments turn, and return counts
FBullCowCount FBullCowGame::SubmitValidGuess(FString Guess)
{
MyCurrentTry++;
FBullCowCount BullCowCount;
//loop through all letter in the hidden word
int32 WordLenght = MyHiddenWord.length(); //assuming same length as guess
for (int32 MHWChar = 0; MHWChar < WordLenght; MHWChar++) {
//compare letters against the guess
for (int32 GChar = 0; GChar < WordLenght; GChar++) {
//if they match then
if (Guess[GChar] == MyHiddenWord[MHWChar]) {
//increment bulls if they're in the same place
if (MHWChar == GChar) {
BullCowCount.Bulls++;
bIsGameWon = BullCowCount.Bulls == WordLenght;
}
//increment cows if not
else {
BullCowCount.Cows++;
}
}
}
}
return BullCowCount;
}