IF(Letterseen[Letter]= true)

I am aware that this conditional fails to do what its expected from it. In the course you typed IF(Letterseen[Letter]), but to be honest its a conditional which is evaluating and expecting a true value in order to proceed. If the value isn’t even there why is a) populating the map, b) assuming a true value.

bool FBullCowGame::isisometric(ftext GuessText)
{

TMap <char, bool> Letterseen;
for (auto Letter : GuessText)
{
Letter = tolower(Letter);
if (Letterseen[Letter])
{
return false;
}
else
{
Letterseen[Letter] = true;
}
}
return true;
}

Your title is missing a ‘=’, should be ‘==’ if you wanted an equality check. Anyway, if you look at std::map operator[]

and

And since 0 == false that would fail the if statement.

Privacy & Terms