the simplest solution would probably be to build a usedQueue length of length k (where k is the number of choices before the selection is resolved.) When you select the selection, remove it from the original list and put it in usedQueue . Then, if usedQueue.length > k , put one back in your array.
As already mentioned, this greatly reduces the randomness of your algorithm. However, it has practical applications (take a look at iTunes.)
source share