[Solved] How can i Generate a random number without repeat

Your blocks change btn to (1.2.3.4. empty )
i dont want in row
in mine it get what exacty i want and some times say undefined i dont know why
first time work second time undefiend

Thanks all for Help
thats to Make a random number


for test
https://x.thunkable.com/copy/8a144ddb1998bb84707d282c667a58af

I think the problem was that you incorrectly copied my example.

1 Like

i gave you a pick with what i did … it works fine in first test when i open the app again it get undefiened
it worked well then undefiend in last btn click

maybe i did something wrong but this what i did with ur idea

what i want to say my problem is solved at least

You get undefined because your list runs out. It’s not an error in the code. It was for example purposes. You would need to add logic to not perform the task of the list is empty.

I will post a slightly different example later today that won’t produce this error.

One of the problems with Thunkable X is that It doesn’t allow you to create blocks from images (unlike App Inventor) and you need to manually create blocks. You did this, but you made a mistake. I think you might be interested in finding this bug yourself to develop mindfulness. If this is not interesting, then you can assume that my example worked incorrectly and forget it.

1 Like

I think this will work for you. Please study the blocks and consider why I placed them in their locations.

please note, that i only add them no another list for demonstration purposes to show how values get removed and that they do still exist somewhere meaning you could take that number not put it into a list and use it elsewhere in your app.

https://x.thunkable.com/copy/0804620ab5d60ec284a08a17dd13de4d

I have modified the title of this post as there have been multiple solutions put forth. :open_hands: Great work Thunkers!!!