Random component not working?

I'm using blocks found on the forum to make the output of 100 random numbers, but maybe I did something wrong, because the numbers are repeated and after 100 extractions not only continues instead of stopping but leaves many numbers without them ever being selected.
Where am I wrong?
Image-forum

The problem is that you keep resetting the global number list to empty.

Do you just want to shuffle 100 numbers ?

Also, most if not all of your questions should be in the category "MIT AppInventor Help". Please do not use "General Discussion" category.

1 Like

yes.
What does it mean to mix up the numbers in the blank?

I was saying yes I would like to mix the numbers and have them displayed randomly up to the number 100, which I can then reset and repeat the action from the beginning.

Fill a list with 100 different numbers at the start, then shuffle the list.

When you want a random number, copy item 1 then remove item 1 from the list.

When the list becomes empty, refill it.

It works, thanks, but in the label the numbers are displayed all together and with the comma one after the other.
I have to display only one number at a time in the label, with each press of the button, without commas and that the next number eliminates the previous one, basically only one number at a time.

ABG, thanks to you too, but if I knew how to do what you tell me, I would be one of you, but for me it is very difficult that is why TIMALI2, (who I will never stop thanking and with him you and everyone else who has given me a hand in these years.), sends me the complete blocks.
Anyway I found the content of links on the lists really very interesting. I will keep it in mind, but as I wrote, as much as I try to follow and memorize, in the long term everything vanishes for me.

Just pick a number one at a time from the list, increasing your index counter by 1 with each button press, and handle when you reach the length of the list.

:grin:Ora se ti chiedessi come fare e cosa mi stai dicendo, mi metterei ala berlina di tutti quelli del forum che naturlamente mi segnerebbero per tutta la vita come quello che da tempo dimostro.
Ma non te lo chiedo, e mi risparmio la brutta figura.
Per me ogni vostra riga di consigli spesso è arabo, cirillico antico, nonostante possa sembrare palesemente ridicolo per voi che io non comprenda.

I do wonder, however, if you are able to create a complex app as you described and showed in your now deleted posts here, why it is that you are unable to deal with what are simple logic blocks such as these ? If you feel obliged to answer, a short answer would be sufficient...

Yes I am able to create apps of a certain complexity, thanks to complete routines, both yours and others on the forum, like this one and of course something of mine, and some programming memories that emerge here and there.

My skills are those of knowing how to put together these small programs, to create apps, even similar to others, but with something more.

The app I posted, maybe you don't remember but it wasn't the only one.

But my limit is that if I were to remember already, what you described. In a few days I will have already forgotten and if I were to create another app that required it, maybe I would ask for help again not remembering this. It doesn't always happen but frequently.
Thanks again for your time now I will try everything.

I forgot:
When I then enter and connect the various complete blocks, naturally I begin to remember everything I need and also how to insert new routines and until I finish the work at most with a break of one or two days, I have to continue otherwise, when I look at the project even after just a week it seems to me that it was made by others, because I don't remember much of it.
And often I have to start checking what each routine is for and start everything from the beginning.

Everything works perfectly thanks, but I tried to reset first with the button you see and then with Counter at zero and then with both at zero.
But in the first case, the random numbering does not start again, it continues.
In the second case with only Counter at zero, the sequence restarts but repeats the numbers that have already been displayed in the same sequence.
With both at zero, it does the same thing.
I would also like to inform that the sequence is finished, I think I'll do it this way:
If global counter => to 100
Message= reached end of sequence
Then
is it right?

You failed to copy my blocks correctly.

If you want to stop when the sequence has finished all the numbers in the list, then do this.

Several errors:

Length of List block returns the number of items in the list, not length (red for text characters count)

Global variable names should include the word List to remind you of that they are lists, like numberList.

Global number AND global Number? Is this a situation comedy?

Don't worry, even if I didn't report them I followed exactly what you told me. In fact the sequence proceeded regularly until number 100.
Even now with your updates, but at the end of the numbers a warning appeared with all the numbers of the sequence and the error: first The listAll the numbers displayed and then, error to large this,
before your end of sequence information was displayed.
Furthermore, the reset button once pressed, brings everything back to the beginning, even before the end of the entire sequence therefore at any stage of the sequence.

ABG, I hope your clarification was directed to the community, because if it is directed to me I apologize, but if it were possible it would be good to re-propose the blocks with the corrections, otherwise I don't understand.

In short, I would like to stop the sequence at any time by bringing everything back to the beginning.
While at the end of the sequence, before it gives me an error, a warning appears, as you rightly reported, but it didn't work.

Do you also want to re-randomise the numbers 1-100 so that they are in a different order for the next use ?

If you want to leave the numberList the same, then remove the randomise procedure from the reset block.

It is obvious that at each restart of the procedure, the sequence of random numbers must be different. Otherwise, if randomness were always repeated in the same order, it would no longer be randomness.
However, I am a bit confused about the usefulness of the 'random integer from 1 to 100' block. Intuitively, I thought that it was used to generate a sequence of random numbers within a certain range.
Reading your explanations, I understood that a more complex procedure is needed to obtain the desired result. But then, what is the real purpose of this block if it is not able to generate a random sequence on its own?
If a block is called 'random', I would expect it to perform this function directly. Also, it would be useful to have a standard procedure to reset the random number generator, so as not to have to reinvent the wheel every time.
Sorry if my questions may seem trivial, but as you know I am a complete ignoramus in programming.