Hello everyone!
This is what I came up with for the IsIsogram() function. Although, the function doesn’t check against capitalization. For Bulls and Cows, I would hate to lose because of capitalization and therefore, I would suggest handling the player’s input appropriately. For now, I am going to lower case the hidden word and the player’s input outside of this function. I’m sure the course goes over other ways to solve this issue.
/*
Checks if the player's guess is an isogram.
Note: This function doesn't handle capitalization check.
*/
bool UBullCowCartridge::IsIsogram(FString Word)
{
for(int32 i = 0; i < (Word.Len() -1); i++)
{
for(int32 j = (i + 1); j < Word.Len(); j++)
{
if(Word[i] == Word[j])
return false;
}
}
return true;
}