How to avoid getting same integer again

Am using the above block to call an integer, but when I tested in my app, it selected same number many times again & again.
Can we somehow make it work like it doesn’t pick the same number again ?

You need to use a list block and add the used numbers in the list. Once you get a random number, check the list to see if number exist

2 Likes

Or App Inventor Code Snippets | Pura Vida Apps

/Boban

1 Like

Untested code, but it should work. Do let me know if there are any bugs.

2 Likes

Try this:
05-18_24_33

Timer enabled is just for testing(I know it will not work)

1 Like

Thanks everyone for giving me ideas, my problem is solved and I have tested it is working great so here is the snap of block that I configured may be it will help others also,

1 Like

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