Set of random numbers that cannot repeat?

Hello. I have another question.


I am making this game where you are in a "battle arena" and there is a guy you talk to, and he randomly selects a number, which selects a person, whose variable is also random.


E.g. You walk up to this guy. He then picks the number "2". (variable "A")


Then every NPC picks a random number. In this case it is "2"(variable "B", "C", "D", "E", etc.)


Another NPC also ends up picking "2".


I would go with this, but how can I prevent 2 people from choosing the same number while keeping it random?


Thanks!
I don't think I understand what you wish to do here. What are you ultimately trying to accomplish here? Right now it seems like an odd number guessing game based on the description you gave, and based on that all I can suggest is you do a variable check to see if the variables are equal, and if so, pick another random number.


If that doesn't do what you want, please provide a more detailed description of what  you wish to accomplish. That way we can help you. Though...side note...whatever we set up will no longer be truly random, so you might need to remove the words in bold. That is because the minute you block a repeat number, the sequence generated violates the definition of a sequence of random numbers.
Ya, your description is kind of vague, you need to be a little more detailed in what you are asking. I understand you want something to be picked at random.


Your "Arena Guy": does he pick a random number? And the number is a random person?


Then you walk up to the Random Person and they too pick a random number?


Then "Every" NPC picks a number? How many NPC's are there? Why are they picking numbers? Why are they all picking the number "2" in your example?


Another NPC also end up picking 2 - why? Are they part of "Every" NPC?


What are the variables for?


I kinda went overboard on the questions above, but letting us know what you are trying to do in detail can let us help you figure out exactly what the issue is and how to best help your situation.
Ya, your description is kind of vague, you need to be a little more detailed in what you are asking. I understand you want something to be picked at random.


Your "Arena Guy": does he pick a random number? And the number is a random person?


Then you walk up to the Random Person and they too pick a random number?


Then "Every" NPC picks a number? How many NPC's are there? Why are they picking numbers? Why are they all picking the number "2" in your example?


Another NPC also end up picking 2 - why? Are they part of "Every" NPC?


What are the variables for?


I kinda went overboard on the questions above, but letting us know what you are trying to do in detail can let us help you figure out exactly what the issue is and how to best help your situation.

It's fine. bgillisp answered my question.
I don't think I understand what you wish to do here. What are you ultimately trying to accomplish here? Right now it seems like an odd number guessing game based on the description you gave, and based on that all I can suggest is you do a variable check to see if the variables are equal, and if so, pick another random number.


If that doesn't do what you want, please provide a more detailed description of what  you wish to accomplish. That way we can help you. Though...side note...whatever we set up will no longer be truly random, so you might need to remove the words in bold. That is because the minute you block a repeat number, the sequence generated violates the definition of a sequence of random numbers.

Basically I wanted a game where you battle a random NPC, but that's not important as your reply answered my question.


Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/set-of-random-numbers-that-cannot-repeat.62877/