I made it a boolean instead lol
void UBullCowCartridge::BeginPlay() // When the game starts
{
Super::BeginPlay();
const FString WordListPath = FPaths::ProjectContentDir() / TEXT("WordList/HiddenWordList.txt");
FFileHelper::LoadFileToStringArray(Words, *WordListPath);
SetupGame(); // Setting up game
TArray<FString> ValidWords;
for (int32 i = 0; i < Words.Num(); i++) // Get each index on the array
{
if (GetValidWords(Words[i]))
{
ValidWords.Emplace(Words[i]);
}
}
PrintLine(TEXT("%i"), ValidWords.Num());
}
bool UBullCowCartridge::GetValidWords(FString Word)
{
if (Word.Len() >= 4 && Word.Len() <= 8)
{
if (IsIsogram(Word))
{
return true;
}
return false;
}
return true;
}