Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Random Number Generator

Display your little helpful snippets of code that may help us all get something done

Re: Random Number Generator

Postby noobgrammer on Mon Oct 05, 2009 1:22 pm

I did use your original post that was the one I posted earlier on with the first number rand problem.

They both comes out with the same results pretty balanced. My question about it all is everywhere I read says the rand() is a crappy rand but does what's necessary for the beginner.

So what is considered a good rand generated output?

I've read the mersenne twister is a good random generator but I'm wanting to know the output result. A kind of idea.

An example would be the one I posted and what yellowarrowplane posted give the numbers 1-10 how many times they come up depending on the size you put in. On mine and his they both come up with similar results. So would a truly good generator not come out balanced like ours did and each time the random generator would be completely different balance, meaning like first run numbers 2,5,7 will come out with more hits but on the next run 2, 9 will have higher hits so as to break the balance.

the mersenne twister is to complicated for me to figure out how to use yet so I could not run a test to see for myself

I guess this is really what I should have said in the prior post. That was what was going through my head when I posted it but I get ahead of myself and forgot to ask. As with getting ahead of myself this question is probably one of those.
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 176
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Random Number Generator

Postby antiRTFM on Mon Oct 05, 2009 3:33 pm

Look into the Boost.Random library for lots of info on the subject
User avatar
antiRTFM
Administrator
 
Posts: 462
Joined: Sun Apr 13, 2008 9:10 am

Previous

Return to Snippets

Who is online

Users browsing this forum: No registered users and 0 guests