Generating non-sequential non-repeating numbers
-
I came across the need to generate sequence of short numbers (e.g. 6 digits) that will be non-sequential and prefarrably non-repeating - or at least non-repeatin within certain interval. I guess there must be well known algorithms that can achieve this, but googling did not help me to find them. So in case you know such algorithms, please enlighten me. Thanks in advance
Вагиф Абилов MCP (Visual C++) Oslo, Norway If you're in a war, instead of throwing a hand grenade at the enemy, throw one of those small pumpkins. Maybe it'll make everyone think how stupid war is, and while they are thinking, you can throw a real grenade at them. Jack Handey.
-
I came across the need to generate sequence of short numbers (e.g. 6 digits) that will be non-sequential and prefarrably non-repeating - or at least non-repeatin within certain interval. I guess there must be well known algorithms that can achieve this, but googling did not help me to find them. So in case you know such algorithms, please enlighten me. Thanks in advance
Вагиф Абилов MCP (Visual C++) Oslo, Norway If you're in a war, instead of throwing a hand grenade at the enemy, throw one of those small pumpkins. Maybe it'll make everyone think how stupid war is, and while they are thinking, you can throw a real grenade at them. Jack Handey.
-
Vagif Abilov wrote:
MCP (Visual C++)
For a MCP you sure have problems reading the BIG RED LETTERS! :sigh:
xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 beta 1 - out now!
((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))leppie wrote:
BIG RED LETTERS
Maybe I'm color-blind, or just blind, but they look black to me - and though bold are not that big! Still... you'd think people would know by now... :)
-
leppie wrote:
BIG RED LETTERS
Maybe I'm color-blind, or just blind, but they look black to me - and though bold are not that big! Still... you'd think people would know by now... :)
Create a New Post and they will appear in BIG RED LETTERS They are only black on this page. How long have you been posting on CP? :)
------------------------------------ We hang the petty thieves and appoint the great ones to public office. - Aesop
-
Create a New Post and they will appear in BIG RED LETTERS They are only black on this page. How long have you been posting on CP? :)
------------------------------------ We hang the petty thieves and appoint the great ones to public office. - Aesop
BAH! :-O
Dalek Dave wrote:
How long have you been posting on CP?
I'm usually trying to answer your fiendish ccc's, bot starting my own posts!
-
Create a New Post and they will appear in BIG RED LETTERS They are only black on this page. How long have you been posting on CP? :)
------------------------------------ We hang the petty thieves and appoint the great ones to public office. - Aesop
Phew! For a moment I thought the red was blood from the BIG BOLD BLACK letters being hammered into my brain ;P
xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 beta 1 - out now!
((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x)) -
BAH! :-O
Dalek Dave wrote:
How long have you been posting on CP?
I'm usually trying to answer your fiendish ccc's, bot starting my own posts!
-
Phil Uribe wrote:
bot starting my own posts!
You have/are a bot? ;P
xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 beta 1 - out now!
((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))leppie wrote:
You have/are a bot?
feels like it some days....
-
I came across the need to generate sequence of short numbers (e.g. 6 digits) that will be non-sequential and prefarrably non-repeating - or at least non-repeatin within certain interval. I guess there must be well known algorithms that can achieve this, but googling did not help me to find them. So in case you know such algorithms, please enlighten me. Thanks in advance
Вагиф Абилов MCP (Visual C++) Oslo, Norway If you're in a war, instead of throwing a hand grenade at the enemy, throw one of those small pumpkins. Maybe it'll make everyone think how stupid war is, and while they are thinking, you can throw a real grenade at them. Jack Handey.
http://en.wikipedia.org/wiki/Linear_feedback_shift_register#Galois_LFSRs[^] but shhhhhh... :)
-
I came across the need to generate sequence of short numbers (e.g. 6 digits) that will be non-sequential and prefarrably non-repeating - or at least non-repeatin within certain interval. I guess there must be well known algorithms that can achieve this, but googling did not help me to find them. So in case you know such algorithms, please enlighten me. Thanks in advance
Вагиф Абилов MCP (Visual C++) Oslo, Norway If you're in a war, instead of throwing a hand grenade at the enemy, throw one of those small pumpkins. Maybe it'll make everyone think how stupid war is, and while they are thinking, you can throw a real grenade at them. Jack Handey.
Put them in a bag, shake them up, and draw one out at a time.
-
http://en.wikipedia.org/wiki/Linear_feedback_shift_register#Galois_LFSRs[^] but shhhhhh... :)
Thanks!
Вагиф Абилов MCP (Visual C++) Oslo, Norway If you're in a war, instead of throwing a hand grenade at the enemy, throw one of those small pumpkins. Maybe it'll make everyone think how stupid war is, and while they are thinking, you can throw a real grenade at them. Jack Handey.
-
I came across the need to generate sequence of short numbers (e.g. 6 digits) that will be non-sequential and prefarrably non-repeating - or at least non-repeatin within certain interval. I guess there must be well known algorithms that can achieve this, but googling did not help me to find them. So in case you know such algorithms, please enlighten me. Thanks in advance
Вагиф Абилов MCP (Visual C++) Oslo, Norway If you're in a war, instead of throwing a hand grenade at the enemy, throw one of those small pumpkins. Maybe it'll make everyone think how stupid war is, and while they are thinking, you can throw a real grenade at them. Jack Handey.
Vagif Abilov wrote:
I guess there must be well known algorithms
pi
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb) John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."
-
Vagif Abilov wrote:
MCP (Visual C++)
For a MCP you sure have problems reading the BIG RED LETTERS! :sigh:
xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 beta 1 - out now!
((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))leppie wrote:
For a MCP you sure have problems reading the BIG RED LETTERS! :sigh:
And you seem to be having trouble determining what is a programming question. He's not asking for anyone to provide code for something he doesn't know. He just doesn't want to reinvent the wheel and was looking for a ready made algorithm or class. Perfectly reasonable question for the Lounge.
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004