I'm trying to create a function that randomly returns a value from a list but remembers the values that have been given before. At the end when the list is empty it should return an empty list. Basically like emptying a bucket full of eggs one at a time.
Suppose I have two lists:
data1 = Range; data2 = Range;
Assume a function
I tried playing with down-values but that doesn't work.
getRandomItem[data1] two times would give (e.g)
getRandomItem[data2] two times would give (e.g)
At the end as stated before when all items are chosen both
I would like to do that without declaring
data2 as global variables nor do I which to change/alter them.
So, basically I presume the function itself should remember which data has been given to it and where it had left the previous time.