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. General Programming
  3. Algorithms
  4. Random number generator

Random number generator

Scheduled Pinned Locked Moved Algorithms
c++tutoriallounge
9 Posts 7 Posters 0 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.
  • K Offline
    K Offline
    Kwanalouie
    wrote on last edited by
    #1

    I would like to understand how random number generators used in various compilers/websites vary. I would like to do some random number tests on my home PC using Visual C++ 6.0 to simulate results that other web based random number generators might produce or that other compilers might produce. For example, suppose I go to a poker website which generates "random" card sequences. I would like to use that same random number generator scheme to run simulations on my PC - how would I go about matching random number generators to do this. I'm guessing there can't be that many different random number generators in use Thanks!

    S L M C Y 5 Replies Last reply
    0
    • K Kwanalouie

      I would like to understand how random number generators used in various compilers/websites vary. I would like to do some random number tests on my home PC using Visual C++ 6.0 to simulate results that other web based random number generators might produce or that other compilers might produce. For example, suppose I go to a poker website which generates "random" card sequences. I would like to use that same random number generator scheme to run simulations on my PC - how would I go about matching random number generators to do this. I'm guessing there can't be that many different random number generators in use Thanks!

      S Offline
      S Offline
      Scorch
      wrote on last edited by
      #2

      Most use time and try to obfuscate it beyond recognition with formulas...no idea if there's a "standard" formula for it though. Use "include ctime" and use srand(time()) . (Just search for random number generator in google and you can probably find source code for one...) If you're trying to figure out how to cheat at poker games you'll have to figure out what formula they're using :laugh: .

      modified on Thursday, July 10, 2008 4:11 PM

      1 Reply Last reply
      0
      • K Kwanalouie

        I would like to understand how random number generators used in various compilers/websites vary. I would like to do some random number tests on my home PC using Visual C++ 6.0 to simulate results that other web based random number generators might produce or that other compilers might produce. For example, suppose I go to a poker website which generates "random" card sequences. I would like to use that same random number generator scheme to run simulations on my PC - how would I go about matching random number generators to do this. I'm guessing there can't be that many different random number generators in use Thanks!

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        There is an infinite number of random number generators. And I don't mean aleph-null infinite, but much more! Of course some could be more popular than others, but you figuring out which RNG is behind a particular game site is, well, rather improbable. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        Voting for dummies? No thanks. X|


        1 Reply Last reply
        0
        • K Kwanalouie

          I would like to understand how random number generators used in various compilers/websites vary. I would like to do some random number tests on my home PC using Visual C++ 6.0 to simulate results that other web based random number generators might produce or that other compilers might produce. For example, suppose I go to a poker website which generates "random" card sequences. I would like to use that same random number generator scheme to run simulations on my PC - how would I go about matching random number generators to do this. I'm guessing there can't be that many different random number generators in use Thanks!

          M Offline
          M Offline
          Mark Churchill
          wrote on last edited by
          #4

          Its likely that a sensible poker site of any size would be using the cryptographically strong RNG. You've got just about zero hope of predicting that, as (at least the windows one is) its based on an entropy pool setup. Its possible that the bigger sites use a hardware RNG as well. (Not that I think there's a good reason beyond it being cool) ;)

          Mark Churchill Director Dunn & Churchill Free Download:
          Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.

          1 Reply Last reply
          0
          • K Kwanalouie

            I would like to understand how random number generators used in various compilers/websites vary. I would like to do some random number tests on my home PC using Visual C++ 6.0 to simulate results that other web based random number generators might produce or that other compilers might produce. For example, suppose I go to a poker website which generates "random" card sequences. I would like to use that same random number generator scheme to run simulations on my PC - how would I go about matching random number generators to do this. I'm guessing there can't be that many different random number generators in use Thanks!

            C Offline
            C Offline
            cp9876
            wrote on last edited by
            #5

            Some bedtime reading NIST 800-90[^]

            Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

            1 Reply Last reply
            0
            • K Kwanalouie

              I would like to understand how random number generators used in various compilers/websites vary. I would like to do some random number tests on my home PC using Visual C++ 6.0 to simulate results that other web based random number generators might produce or that other compilers might produce. For example, suppose I go to a poker website which generates "random" card sequences. I would like to use that same random number generator scheme to run simulations on my PC - how would I go about matching random number generators to do this. I'm guessing there can't be that many different random number generators in use Thanks!

              Y Offline
              Y Offline
              yassir hannoun
              wrote on last edited by
              #6

              this might look silly but i ve created a simple "random numbers generator" based on the DateTime class

              double time = DateTime.Now.Millisecond;
              double randomnumber = time / 1000;
              Console.WriteLine("random is :{0}",randomnumber.ToString());

              what do u think pretty strong huh ?? ;P

              P 1 Reply Last reply
              0
              • Y yassir hannoun

                this might look silly but i ve created a simple "random numbers generator" based on the DateTime class

                double time = DateTime.Now.Millisecond;
                double randomnumber = time / 1000;
                Console.WriteLine("random is :{0}",randomnumber.ToString());

                what do u think pretty strong huh ?? ;P

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

                Good enough for some purposes... I suppose. :~

                Y 1 Reply Last reply
                0
                • P PIEBALDconsult

                  Good enough for some purposes... I suppose. :~

                  Y Offline
                  Y Offline
                  yassir hannoun
                  wrote on last edited by
                  #8

                  Well it is :p

                  P 1 Reply Last reply
                  0
                  • Y yassir hannoun

                    Well it is :p

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

                    Then at least eliminate a step: double time = DateTime.Now.Millisecond / 1000**.0** ;

                    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