My solution to the IsGameWon() function didn’t involve making a Boolean or checking for the number of bulls. I added a guess parameter to the function and simply did:
// Check to see if the game has been won
bool FBullCowGame::IsGameWon(FString Guess) const
{
if (Guess == MyIsogram)
{
return true;
}
else
{
return false;
}
}
Can somebody tell me whether this is worse than the method implemented by Ben? I thought that adding a new variable and changing both the SubmitValidGuess() and Reset() functions would have been much more work whereas my method was self-contained and could be made much simpler by just using
// Check to see if the game has been won
bool FBullCowGame::IsGameWon(FString Guess) const
{
return (Guess == MyIsogram)
}
By the way MyIsogram is what I called the MyHiddenWord variable