Set of random numbers that cannot repeat?

unsightedmetal6

Villager
Member
Joined
May 31, 2016
Messages
9
Reaction score
0
First Language
English
Primarily Uses
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!
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
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.
 

GreyStone84

Sic Gorgiamus Allos Subjectatus Nunc
Veteran
Joined
Jun 24, 2015
Messages
295
Reaction score
95
First Language
English
Primarily Uses
RMVXA
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.
 

unsightedmetal6

Villager
Member
Joined
May 31, 2016
Messages
9
Reaction score
0
First Language
English
Primarily Uses
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.
 

unsightedmetal6

Villager
Member
Joined
May 31, 2016
Messages
9
Reaction score
0
First Language
English
Primarily Uses
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!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,230
Members
137,607
Latest member
Maddo
Top