I'd like to be able to choose a number from a dynamic list of numbers, I think in probability it's called a dependent event.

I have three sprites (or one sprite and two instances of another sprite to save resources), each sprite needs to choose a number but cannot choose from one already chosen.

For example the list is 0,1,2,3,4

Sprite instances x y and z each choose in order.

X picks 0, so y gets 1,2,3,4, it chooses 3. Now z can choose from 1,2,4 and chooses 4.

so we end with

x 0, y 3, z 4.

then these are destroyed by going off screen and the new instances can choose from 0,1,2,3,4,

How would I go about doing this?

I've been working on this problem for a few days now and tried using random trees but it just ends up being indecisive and I can't exit the loop because there is always a duplicate. I'd am looking for a way to set up such a dynamic list.