Good idea to seed a RNG each time you use it?

2019-06-09 17:20发布

I'm using the Mersenne twister algorithm to shuffle playing cards. Each time the deck needs to be shuffled I seed it with time(NULL) + deckCutCardNumber which is where the user chose to cut the deck. Would I get better results from only seeding it the first hand and continuing to generate them with the same seed or is this method more random?

Thanks

7条回答
我只想做你的唯一
2楼-- · 2019-06-09 18:00

Yes, you would get better results when not seeding every time. That's the purpose of a (good) random number generator.

In this special case the first value would just increase by the time you waited between the shuffles, while a continuously applied rng would give you numbers across it's whole range.

查看更多
登录 后发表回答