How to change automatically and random a code of a game "Guess the number"?

Hi to everyone, I developed a simple application, you have to guess the number and if you guess it, all the horizontal arragments they become invisible and a message appears saying that you have won, and if you don't guess the number there is a notifier that says that you have failed but that you can try it again. The problem I have is that for example the code that I put to win is 111 and if the person guesses, the application loses sense because if that person re-enters they already know that they have to enter the number 111 and they will win again and it gets boring. What I would like is that once you have won, the code it changes automatically and random in a range of numbers from 0 to 999. Could that be done? Can somebody help me? I upload the project apk in case someone can see it and can tell me how to modify the blocks so that the number change automatically every time someone has hit the correct number. Thanks in advance..!!

I can´t upload the apk file, but I will upload the blocks of the game in png

guess1 guess2 guess3 guess4

I just upload the block of the number 1 but all the rest are the same..! Please if anybody can help me I´ll be vey grateful..!

You need some code similar to

randomGuess and aquiring some skills regarding Programming Your App to Make Decisions .

Hopefully these code snippets will give you some ideas. Experiment Patricio.

For more ideas, you can search the Gallery

... follow the green numbers

Thanks for your reply Steve. I am a beginner in application development, I became interested in them recently, a year ago and it helps me to learn something useful and to keep my head entertained in the middle of this pandemic and quarantine. I'm going to keep trying and testing, thanks for the blocks you suggested Steve ..! And it had not occurred to me to look for a similar application in the gallery to see how they have solved the issue of setting a new random number, I have already been seeing several, they are not the same as mine but I could apply some of their solutions ..! Thank you very much again .. !!

1 Like