Since you seem to be working with a fixed and finite number of ids, it would be easier to shuffle them once and write them to a file. Then each time you need one, take the last one in the file and truncate it so it cannot be used again. Once you get to an empty file, shuffle them again and re-write the file.
In reply to Re: Don't-Repeat-Myself code for improvement
by BrowserUk
in thread Don't-Repeat-Myself code for improvement
by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |