Rand Seed

BlitzMax Forums/BlitzMax Beginners Area/Rand Seed

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

ok, here's as good a truly random number as you're going to need:

Local s:TStream = ReadStream("http::www.random.org/cgi-bin/randnum?num=1&min=0&max=100000&col=1")
Global random_seed:Int
Global r:String
If Not s RuntimeError("failed to retrieve a random number seed")

While Not Eof(s)
	r:String = ReadLine(s)
Wend
CloseStream(s)

random_seed = r.toint()

Print random_seed
SeedRnd(random_seed)
Print Rand(0,100)
End