Time, random replacement?

Hi

I would like to create a better version of a randomizer for a c++ program. Any recommendations?

Basically
I would like to have a function that can use time to set up a seed or maybe a hash. RandomSeed(time)

Then a second value RandomValue()% value.

I don't want the later function to be time dependent meaning if two computer ran the same code starting at the same point but ending minutes apart. The value will still be the same.

Vivienne
Last edited on
thats actually c randomized integers, not c++. you would be hard pressed to implement a better prng than that (afaik. i just recently got back into c). for c++, i still think you would be hardpressed to do it, because the <random> lib is pretty solid
I know the library is solid. I just need it to work this way for a procedural terrain system I'm working on. I want to make sure I'm guranteed hte same result on different platforms.

Lets sayy I set a seed. Then the two computers does the random command after the seed. Three hours apart, the result still have to be the same. Throwing some crazy time frame just saying.
Topic archived. No new replies allowed.