How does a random number generator work?

前端 未结 7 1254
终归单人心
终归单人心 2020-11-29 05:27

How do random number generator works? (for example in C/C++ Java)

How can I write my own random number generator? (for example in C/C++ Java)

7条回答
  •  [愿得一人]
    2020-11-29 05:58

    There is a lot of information available about how they are working ... see Konamiman's answer and use google a bit.

    Why would you like to write a new random generator? You probably should not try to do so ... until you need something very special. For example in a game you could use a shuffle bag which produces 'fair' random values - have a look at this interesting question on SO.
    I post this here, because I really liked the idea and implementation when I read about it the first time :)

提交回复
热议问题