So I’m working through the lecture, getting a little bit stuck without the hints, but then I thought I had it with this
bool UBullCowCartridge::IsIsogram(FString Word) const // Isogram Check
{
int32 LetterA = 0;
int32 LetterB = LetterA + 1;
for (; LetterA < Word.Len(); LetterA++)
{
for (; LetterB < Word.Len(); LetterB++)
{
if (Word[LetterA] == Word[LetterB])
{
return false;
}
}
}
return true;
}
I tested it but for some reason whenever a word like “staff” is entered, it doesn’t see the repeating letters, can anyone help me figure out what I’ve missed? After comparing it to the example code, I can’t see why it’s not working.
EDIT: After a little more testing it seems to only be checking the first three letters maybe? It is seeming very inconsistent but I can’t seem to get it to work as it should. Example image attached.