Bull Cow - Scrolling up?

Hi, :slightly_smiling_face:

In reference to the “extra credit” section; I would like to add a scroll up (and down) capability to the game text so the player can look at their previous guesses and their bulls and cows for each guess.

I did a little (not a whole lot) of digging but didn’t find much information that was helpful to a beginner.

Any suggestions?

That would require quite a bit of work and need to edit the code Sam wrote in Console/

Instead you could store a TArray<TPair<FString,FBullCowCount>> (Or make a struct for FString and FBullCowCount to use for the Array). And allow for the user to enter a phrase to print out the list.

So it’s not a simple addition I guess… :sweat_smile:

Thank you. That’s an interesting suggestion on another way to solve the issue. However I worry for long games with longer lives the list it would print out might still be unreadable without a scroll feature. I may still noodle around with attempting to add what you suggested for my own edification.

I would be interested in finding out how to add features like scrolling in future lessons if it were available.

Not quite no, you’ll have to rework the code Sam wrote as what you see on screen is what is there in memory. When you go beyond the max lines the line at the top is simply removed

So you would have to rework how the text is displayed so that only the most recent MaxLines amount of text is displayed and the rest is kept within the array as history, as well as how to cycle up and down that. You’d probably want to limit the amount of history as well so that you don’t store an insane amount of text in memory.

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

Privacy & Terms