Results 1 to 4 of 4

Thread: RE: Rolling Dice

  1. #1

    Thread Starter
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    Re: [.NET 2.0+] Rolling Dice

    Great post!
    Randomness is, how unlikely it may seem, very hard to achieve. I do know that the one created by computer applications is simulated, though I don't know exactly how it's done.

    I guess what I'm saying is; could explain how the Random class actually works? How is the random number generated? That'd be awesome to know .
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [.NET 2.0+] Rolling Dice

    Quote Originally Posted by vbNeo
    Great post!
    Randomness is, how unlikely it may seem, very hard to achieve. I do know that the one created by computer applications is simulated, though I don't know exactly how it's done.

    I guess what I'm saying is; could explain how the Random class actually works? How is the random number generated? That'd be awesome to know .
    I'm happy to answer this question but this CodeBank thread is not really the place for it. I've asked the moderators to split it off into its own thread in the .NET D & A forum.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Rolling Dice

    Posts split from CodeBank thread

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Rolling Dice

    The Random class uses a seed value to generate a pseudo-random sequence of numbers based on an algorithm. The sequence varies without apparent relationship as the seed value varies. It actually generates values in the range 0.0 <= R < 1.0 and the Next method performs some mathematics on that value to produce an Integer within a specified range. If you want to see exactly how it's done then I suggest that you install .NET Reflector and examine the class.

    The System.Security.Cryptography namespace has types that can generate random values to a cryptographically-acceptable level of randomness, if you need really random.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width