Hello!
Here is my improved Isogram function made by a different way
bool UBullCowCartridge::IsIsogram(FString word) const
{
for (int Index = 0; Index < word.Len(); Index++)
{
for (int Comparison = 0; Comparison < word.Len(); Comparison++)
{
if (Index != Comparison) // Avoids same integer of Index and Comparison to be compared.
{
if (word[Index] == word[Comparison])
{
return true;
}
}
}
}
return false;
}
I tried to check every letter (from the first one to the last one) just for make it a bit more difficult.
And making sure that Comparison and Index’s values are not the same to avoid an issue that I found (which regardless the word I type, always shows “No repeating letters” in the Bull & Cows videogame.