Make a Randomized Variable not to run the same number twice in a row?

The title itself is the full question.
I've been doing randomized commands inside a few events that I'm currently working on and the way the Control Variable, when set to operand "Random between 1 to 10", sometimes is randomly choosing the same number two to three times in a row, giving the end results in two to three times in a row.

Is there a way to make the Control Variable not randomly choose the same number twice in a row?
* Store the first result in a second variable; let's call this A.
* The second time you need a random number, get a random number from 1 to 9 instead of 1 to 10.
* If the result is equal to or greater than A, increment it by 1.
Thanks, I'll try that.
I think a slightly easier way of doing it would be to store the result in a separate variable.
Then, every time the random number is rolled, it'll compare the result with the value in the separate variable, and it it's equal, repeat the roll until it isn't the same.
a better way would be to use array elements, but that would require scripts and can't work with event commands alone.
basically create a ten-element array containing each number once, then instead of using a random number 1-10 you run a random number 1-array length. and the number on the index found is removed from the array before the next step.
I was about to suggest the same thing as Andar: have an array with X elements (X being the upper bound of your random range), then either slice a random index from it, or randomly rearrange the elements and pop off the last one each time you need a value out.

Original thread: https://forums.rpgmakerweb.com/threads/make-a-randomized-variable-not-to-run-the-same-number-twice-in-a-row.143089/