I assume there is a way easier way we are going to do this but… this works! Took me a little bit to workout the last 2 characters being checked also I’m sure it’s not good to do nested while loops like this?
If you’re wondering I didn’t set the checked to 1 immediately because of the way I was comparing them before and was afraid I could get an error if somehow IsIsogram(); was called without a guess.
void UBullCowCartridge::IsIsogram(FString Guess)
{
int check = 0;
int checked = 0;
if ((Guess.Len()) != 0)
{
checked = 1;
while (check != (Guess.Len()) - 1)
{
while (checked != Guess.Len())
{
if (Guess[check] == Guess[checked])
{
PrintLine(TEXT("That's not an isogram lul"));
return;
}
else
{
++checked;
}
}
++check;
checked = check + 1;
}
}
}```