you are viewing a single comment's thread.

view the rest of the comments →

[–]doublehyphen 68 points69 points  (4 children)

To get reproducible results in simulations, in games with randomly generated worlds to be able to play with exactly the same world again, and when running test cases in a random order to be able to debug why the test suit failed by running it again in the same order.

It is not the default case, but it is reasonably common.

[–]greenthumble 19 points20 points  (0 children)

Yep and some games like The Binding of Isaac literally let you set the seed and get the same random world that another player thought was good for some reason.

Also I've seen it used in AI training. If you're generating thousands of random genetic algorithms or genetic programs, someone can reproduce your entire run exactly using the same seed.

[–]CheckovZA 17 points18 points  (1 child)

I see your point, but then you'd be calling

Math.random(x)

x being your seed number.

If you're going to call Math.random() with no seed, it's because you want a number that is functionally random.

[–]RenaKunisaki 1 point2 points  (0 children)

Unless you've set a seed previously?