Random Number Question

Just starting out? Need help? Post your questions and find answers here.
UUICEO
User
User
Posts: 57
Joined: Tue Mar 10, 2009 9:09 pm
Location: Shakopee, Minnesota. USA

Random Number Question

Post by UUICEO »

If I use RandomSeed(1) in my program, will it produce the same value when I use Random(100) on every OS/CPU it is run on?

Code: Select all

RandomSeed(1)

Debug Random(100); Expected output = 72

RandomSeed(ElapsedMilliseconds())

Debug Random(100); Expected output is more random.
Windows 7 Ultimate x64 / PureBasic 5.21 LTS / ProGUI Platinum / PureVision / http://www.linkedin.com/groups/PureBasi ... =&trk=tyah
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: Random Number Question

Post by Shield »

Yes, it should. If it doesn't it must be a bug. :)
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
UUICEO
User
User
Posts: 57
Joined: Tue Mar 10, 2009 9:09 pm
Location: Shakopee, Minnesota. USA

Re: Random Number Question

Post by UUICEO »

I thought it should work that way.. I just wanted to make sure as I don't have my VM Workstation setup on this computer and no other OS's to test on.

Thanks for the reply.
Windows 7 Ultimate x64 / PureBasic 5.21 LTS / ProGUI Platinum / PureVision / http://www.linkedin.com/groups/PureBasi ... =&trk=tyah
Post Reply