Bulls & Cows Extra Features: Show Bulls

Hello everyone!

I am trying to create a feature that shows the player the already guessed Bulls and in what position. For an example, the word is weird. If they guess wired, the game would show: w, , , , d (without the commas). This way the player has a visual clue on what kind of words they should be trying to think of. In Java, you can just append anything to the end of strings, but I am struggling with this one. I don’t understand FString.AppendChar(). I went to try TArray and Emplace that way, but now it seems like I have to create a loop to read the letters. Is there a more efficient way to do this?

What don’t you understand about it?

Thanks for responding Dan.
I took a couple day break and came back to work on the project. I fixed majority of my issues and I was using AppendChar() correctly. I just didn’t realize my function was a const and that’s why it was giving me errors. This is why you don’t code so late at night. Another thing to note, I didn’t realize that I had to do the following when appending a const char:

FString.AppendChar((TCHAR) *"-");

Double quotes is a string, single quotes is a character.

SomeString.AppendChar(TEXT('-'));
1 Like

Thank you for the help. I forgot about the text wrap and the single quotes, even though it was discussed in the lectures. I’ve implemented the feature already, but I am just fixing up some other issues.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms