Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Generating non-sequential non-repeating numbers

Generating non-sequential non-repeating numbers

Scheduled Pinned Locked Moved The Lounge
c++help
13 Posts 8 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Vagif Abilov

    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.

    L Offline
    L Offline
    leppie
    wrote on last edited by
    #2

    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))

    N L 2 Replies Last reply
    0
    • L leppie

      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))

      N Offline
      N Offline
      NeverHeardOfMe
      wrote on last edited by
      #3

      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... :)

      D 1 Reply Last reply
      0
      • N NeverHeardOfMe

        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... :)

        D Offline
        D Offline
        Dalek Dave
        wrote on last edited by
        #4

        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

        N L 2 Replies Last reply
        0
        • D Dalek Dave

          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

          N Offline
          N Offline
          NeverHeardOfMe
          wrote on last edited by
          #5

          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!

          L 1 Reply Last reply
          0
          • D Dalek Dave

            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

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #6

            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))

            1 Reply Last reply
            0
            • N NeverHeardOfMe

              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!

              L Offline
              L Offline
              leppie
              wrote on last edited by
              #7

              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))

              N 1 Reply Last reply
              0
              • L leppie

                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))

                N Offline
                N Offline
                NeverHeardOfMe
                wrote on last edited by
                #8

                leppie wrote:

                You have/are a bot?

                feels like it some days....

                1 Reply Last reply
                0
                • V Vagif Abilov

                  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.

                  P Offline
                  P Offline
                  peterchen
                  wrote on last edited by
                  #9

                  http://en.wikipedia.org/wiki/Linear_feedback_shift_register#Galois_LFSRs[^] but shhhhhh... :)

                  Burning Chrome ^ | Linkify!| FoldWithUs! | sighist

                  V 1 Reply Last reply
                  0
                  • V Vagif Abilov

                    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.

                    P Offline
                    P Offline
                    PIEBALDconsult
                    wrote on last edited by
                    #10

                    Put them in a bag, shake them up, and draw one out at a time.

                    1 Reply Last reply
                    0
                    • P peterchen

                      http://en.wikipedia.org/wiki/Linear_feedback_shift_register#Galois_LFSRs[^] but shhhhhh... :)

                      Burning Chrome ^ | Linkify!| FoldWithUs! | sighist

                      V Offline
                      V Offline
                      Vagif Abilov
                      wrote on last edited by
                      #11

                      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.

                      1 Reply Last reply
                      0
                      • V Vagif Abilov

                        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.

                        E Offline
                        E Offline
                        El Corazon
                        wrote on last edited by
                        #12

                        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."

                        1 Reply Last reply
                        0
                        • L leppie

                          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))

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #13

                          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

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups