RandomSeed across versions and platforms
Posted: Fri Mar 09, 2012 2:38 am
Question:
I want to generate a sequence of random integers using Random() or RandomData(), but it needs to be repeatable any time the program is run... Obviously the solution is to use RandomSeed() with some desired seed to guarantee the same sequence each time!
But to save myself from any future bugs, I'm wondering if there is any possibility for RandomSeed() to give different results in a future version of PureBasic, OR in any of the current versions (4.60 in Mac, Linux, Windows 64-bit -- I currently use Win 32).
Perhaps I am safe, and a good algorithm was chosen 10 years ago, and Random/RandomSeed hasn't changed since?
But I know that some libraries are different across platforms (eg. the Packer algorithm?) and I want to be sure that a Mac or Linux port won't result in different random sequences.
I want to generate a sequence of random integers using Random() or RandomData(), but it needs to be repeatable any time the program is run... Obviously the solution is to use RandomSeed() with some desired seed to guarantee the same sequence each time!
But to save myself from any future bugs, I'm wondering if there is any possibility for RandomSeed() to give different results in a future version of PureBasic, OR in any of the current versions (4.60 in Mac, Linux, Windows 64-bit -- I currently use Win 32).
Perhaps I am safe, and a good algorithm was chosen 10 years ago, and Random/RandomSeed hasn't changed since?
But I know that some libraries are different across platforms (eg. the Packer algorithm?) and I want to be sure that a Mac or Linux port won't result in different random sequences.