#include "BullCowCartridge.h"
#include <string>
void UBullCowCartridge::BeginPlay() // When the game starts
{
Super::BeginPlay();
PrintLine(TEXT("Hello There!!!"));
PrintLine(TEXT("Welcome to the BullCow Game."));
PrintLine(TEXT("Guess an 10 letter Isogram."));
PrintLine(TEXT("Type Your answer and Press Enter."));
FString HiddenWord = TEXT("Journalist");
}
void UBullCowCartridge::OnInput(const FString& Input) // When the player hits enter
{
ClearScreen();
if (Input == HiddenWord)
{
PrintLine(TEXT("You Win"));
}
else
{
PrintLine(TEXT("You Lose"));
}
}
the if-else statement doesn’t work. No matter the answer, it outputs the result as ‘You Lose’.
Edit: It seems in BeginPlay(), I shouldn’t write,
FString HiddenWord = TEXT("Journalist");
but this,
HiddenWord = TEXT("Journalist");
What’s the difference?