Think of each 'seed' as an ice chest, and then the random numbers as ice cubes. You can then use rand(min, max) to go into the seed and choose a number between the min and the max, inclusive. In PHP, you can use srand() to "shuffle" the seeds, so you almost always get a different answer. That starting point then has a bunch of numbers that are "inside" of it that the program chooses from. When you seed the RNG, you are giving it an equivalent to a starting point. This wikipedia article might be able to help you out in the explanation: įrom what I understand, there are basically two parts of an RNG: the seed, and then the random number chosen from that seed. The only really truly random things are acts of God, like lightning. Random Number Generators(RNGs) are really generating pseudorandom numbers, since it's impossible to actually generate a TRULY random number.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |