Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

mt19937 in C++

$
0
0

I have a global variable of type mt19937. I am trying to seed it in main(), but every time I run my app, it gives the same pseudorandom numbers. The code I'm using is listed below. Any idea what kind of beginner's mistake that I'm making?

long unsigned int s = time(0);
mt_rand.seed(s);

Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>