There are other options:
You can use a While loop - generate a random frame number, check if there is a button already with this frame. And either repeat or stop the loop.
Or put all numbers into an array, pick random index and then delete it.
Or use a string variable with the list of frames - pick random token and delete it.
But permutation table is easier than any of those.