Random item without duplicate

i want to retrieve only 5 items from myList and the items should not duplicated. this method i used for getting random 5 items but i am not the logic to get the item without duplicate. so how do i do it?

See here for some ideas

any other method?

I'm laughing at myself :rofl: I know this isn't the proper logic. I always come up with weird solutions. :grin:

Modified :sweat_smile:

Another, condensed, logic:
RandomList.aia (8.8 KB)

Cheers.

1 Like

:smiling_face_with_three_hearts: :heart_eyes: :relaxed:

Happy you liked it ! :hugs:

1 Like

wow....you are a physicist... I love physics. :relaxed:

Yep, a life ago !!!
But don't ask me to explain you quantum mechanics :joy: :joy: :joy:
You'd better follow professor Jim Al Khalili for that .... :grin:
Anyway, if you love physics, then do follow your wishes...
All the best !!!

1 Like

And another (based on Taifun's example)

I am now a secondary school teacher, specializing in math. Recently, Scratch has been introduced into our curriculum. While I never formally studied computer science, my growing understanding, coupled with the assistance of fellow community members, has ignited my curiosity and inspired me to create apps using the MIT platform.

1 Like

Dear, you're definitely right: by crawling the AI2 forum, you'll find tons of "ready made" code and a lot of fellows aimed at assisting anybody who needs help.
PS since you are a teacher and you love physics, let me suggest you to teach your students that "the simplest the best". This applies not only to algorithms, or to physic laws, but to everything they'll do in their life. Please apologise me if I am so verbose....
Cheers, Ugo.

1 Like

I will certainly wholeheartedly follow your advice.

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