Struggled a lot harder than I needed to lol

I was struggling to figure out why my code refused to launch the console, and then I realized after an hour of tinkering with the “Tmap”, “if” and “for” that I simply needed to make my “Guess.length <=1” be a function “Guess.length**()**<=1”. I guess I should have used my rubber duck on this one.

bool FBullCowGame::IsIsogram(FString Guess) const
{
	if (Guess.length() <= 1) { return true; } // so that 0 and 1 letter words are counted as an isogram
		// create a hash table to check letters against each other for the guess, using structure below
	TMap <char, bool> LetterSeen;
	for (auto Letter : Guess)//For all letters in the word
	{	

		Letter = tolower(Letter); //handels mixed lower and upper case
			if (LetterSeen[Letter]) { return false; }

	}
	return true;
}

Dude your game looks sick!

1 Like

Thanks!

Privacy & Terms