void UBullCowCartridge::CalculateBulls(FString const& Guess, int32& Bulls, int32& Cows) const
{
Bulls = 0;
Cows = 0;
for (int32 Index = 0; Index < Guess.Len(); ++Index)
{
Guess[Index] == HiddenWord[Index] ? ++Bulls : ++Cows;
}
}
so what’s going on here?
IsConditionTrue ? IfTrueDoThis : IfFalseDoThat
quite useful if you want to shorten code or give conditional argument for example
PrintLine(bGameWon ? TEXT("You WON!") : TEXT("YOU LOST!"));
more info here:
https://en.cppreference.com/w/cpp/language/operator_other