Random number generator - why seed every time

前端 未结 7 2041
轻奢々
轻奢々 2020-12-06 04:58

I am relative new to c and c++. In java, the language I am used to program in, its very easy to implement random number generation. Just call the the static random-method fr

7条回答
  •  遥遥无期
    2020-12-06 05:40

    The advantage is that you can repeat a random number sequence by supplying the same seed.

    The game Elite used this to store an entire world, consisting of thousands of stars, as a single number. To generate the exact same world a second time, the just supplied the same seed.

提交回复
热议问题