Watch: expected an expression

FBullCowCount FBullCowGame::SubmitGuess(FString Guess)
{
//increment the turn 
MyCurrentTry++;

// setup a return structure 
FBullCowCount BullCowCount; 

int32 HiddenWordLenght = MyHiddenWord.length();

//loop through all letters in the guess 
for (int32 MHWChar = 0; MHWChar < HiddenWordLenght; MHWChar++) {
	//compare letters against the hidden word 
	for (int32 GChar = 0; GChar < HiddenWordLenght; GChar++) {
		//if they match
		if (Guess[MHWChar] == MyHiddenWord[MHWChar]) { //watch added here 
			//increment bulls if they are in the same place
			if (MHWChar == GChar) {
				BullCowCount.Bulls++;
			}
			else {
				//increment cows if they are not 
				BullCowCount.Cows++;
			}
		}
	}
}
	
return BullCowCount; 

}

Also everything blow up with debug assert error if the user entered string is longer that the hidden word, is this by design currently?

For the first issue, you have to highlight the whole expression for it to work. That’s why your getting ‘expected expression’. Looks like you only highlighted half the expression: if (Guess[MHWChar] = =

As for the second question I am also getting an error when too many or too little letters are used but I’m guessing we are going to get to that next.

Privacy & Terms