When we were creating a new list of words in ValidWords, my list did something strange: have a look:
You will notice that “accept, account, across” sandwich the rest of the text in the middle.
I am not sure of the reason, and I double checked my code to the code examples.
Here is the code:
void UBullCowCartridge::BeginPlay() // When the game starts
{
Super::BeginPlay();
SetupGame();
PrintLine(TEXT("The number of possible words is %i"), Words.Num());
PrintLine(TEXT("The Hidden word is: %s."), *HiddenWord);// debug line
TArray<FString> ValidWords;
for (int32 Index = 0; Index < 10; Index++)
{
if (Words[Index].Len() >= 4 && Words[Index].Len() <= 8 )
{
ValidWords.Emplace(Words[Index]);
}
for (int32 Index = 0; Index < ValidWords.Num(); Index++)
{
PrintLine(TEXT("%s."), *ValidWords[Index]);
}
}