Hi everyone. My problem is understanding “Checking Character Part 1” because I didn’t understand very well the declaration of two variables “Index” and “Comparison”.
bool UBullCowCartridge::IsIsogram(const FString Word) const
{
// int32 Index = 0;
// int32 Comparison = Index + 1;
for (int32 Index = 0, Comparison = Index +1; Comparison < Word.Len(); Comparison++)
{
if (Word[Index] == Word[Comparison])
{
return false;
}
}
return true;
// For each letter.
// Start at element [0].
// Compare against the next letter.
// Until We reach [Word.Len() -1]
// if any are the same return false
}