I have about 9 checkboxes in which allows you to pick what items are available for a future function. I then want to call my function to pick a random one of these items X% of the time (X being set by a constant, to determine how often this should happen), one an item is picked, it needs to be pulled from the list so it is not chosen again the next time we need to call foo().
I was thinking I would iterate through the check boxes initially, and add the ones available to a list. I would do a random to determine if I should pull an item, and then pull it from the list then remove the list item.
Is this the best way to do it?
Create a collection that references check boxes. randomly select from this collection and once selected remove it. This way you won’t reuse the same check box.