Lecture 43 IsIsogram()

urc_s02_rangebased_for_loop

#1
bool FBullCowGame::IsIsogram(FString Word) const
{
    TMap<char, bool> LetterSeen;

    if (Word.length() > 1) {
        for (auto Letter : Word)    //foreach
        {
            Letter = tolower(Letter);
            if (LetterSeen.count(Letter)) {
                return false;
            }
            else {
                LetterSeen[Letter] = true;
            }
        }
    }

    return true;
}

#2

OK here’s mine, it’s similar and it seems to work. I like your combining the character length check into that line, neat !

The only thing that we haven’t implemented yet is that the guess word and hidden word still have to case match.

Onwards !