|
| Ishtar (2) | |||
| Hello everyone Please forgive the state of this code, I have quite literally only started coding C++ today. My question is related to rand() and generating very good random numbers (whatever that actually means). I would be grateful if somebody could look at this code and tell me if it will yield a "better" random number than simply seeding with the current time. Thank you for any and all help.
| |||
Last edited on | |||
| Bazzy (3180) | |
rand is not really good in generating 'very good random numbers', you should look for some external library.And I dont like much the goto you have on line 41, it can be easily replaced by a do-while | |
| Ishtar (2) | |
Yes, I agree! I have just done a quick google and found out that goto is outlawed by the civilized c++ community. ;) Thank you. | |
| Tarson (1) | |
| Hello Ishtar, I have found an article about the rand() function with suggestions how to use it when I first tried to use it myself. http://www.eternallyconfuzzled.com/arts/jsw_art_rand.aspx Nevertheless, as Bazzy already pointed out, you might find better random number generators. Have a nice day | |
Last edited on | |
Registered users can post in this forum.
