Select a random element using an offset such that the chosen element is guaranteed to be unique from the last seedOffset selections.
seedOffset
The type of items in the array
The array of items to choose from
The offset into the shuffled array
(default globalScene); The scene to use for random seeding
globalScene
A random item from the array that is guaranteed to be different from the previous result
If the seed offset is greater than the number of choices, this will just choose a random element
const choices = ['a', 'b', 'c', 'd'];const choice1 = randSeedUniqueItem(choices, 0);const choice2 = randSeedUniqueItem(choices, 1);const choice3 = randSeedUniqueItem(choices, 2);assert(choice2 !== choice1);assert(choice3 !== choice1);assert(choice3 !== choice2); Copy
const choices = ['a', 'b', 'c', 'd'];const choice1 = randSeedUniqueItem(choices, 0);const choice2 = randSeedUniqueItem(choices, 1);const choice3 = randSeedUniqueItem(choices, 2);assert(choice2 !== choice1);assert(choice3 !== choice1);assert(choice3 !== choice2);
Select a random element using an offset such that the chosen element is guaranteed to be unique from the last
seedOffsetselections.