EDIT: To generate random values use the uniform_random function in tools.h (remember to include it in the code you are working on)
As some of you may know, the rand()% function in c++ is not truly random. It repeats values and to change this you need to include time.h and srand(time(0));, but still it does not work properly (instead of giving a true random number, it gives increasing numbers until it reaches the top, and then it resets again.
How can I generate truly random values in the source codes? I'm on TFS 1.2, maybe the boost libraries have something? Thanks in advance!
As some of you may know, the rand()% function in c++ is not truly random. It repeats values and to change this you need to include time.h and srand(time(0));, but still it does not work properly (instead of giving a true random number, it gives increasing numbers until it reaches the top, and then it resets again.
How can I generate truly random values in the source codes? I'm on TFS 1.2, maybe the boost libraries have something? Thanks in advance!
Last edited: