![]() |
Random Assigning - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Random Assigning (/Thread-Random-Assigning) |
Random Assigning - Catalan_mistral - 03-04-2017 11:27 AM Need pointing in the right direction, i'll try an explain the scenario Say I have a list of 5 items apple,pear,banana,orange,Football I need to pick a random item then remove it from the list, so that the next pick is a random pick from the remaining 4 items and so on and so forth, until the last pick is the last item left by default. I know I could pick a random item then check to see if it has already been picked, and if it has been then it picks again until it finds one that hasn't been picked before, but I am presuming the larger the list the more chance of it hitting a picked item. RE: Random Assigning - Ben - 03-04-2017 11:48 PM Using LIST would be my choice. http://wiki.spherecommunity.net/index.php?title=LIST Pick a rand number from list.xxx.count, get that element, then remove it from the list. RE: Random Assigning - Catalan_mistral - 03-05-2017 12:13 AM Bah should of thought of that, already played around with lists on another script for the sorting aspect of it, Thank you Ben |