+ 1
Random
I am making a slot machine and my random numbers keep on codeing out the same please help me
3 Antworten
+ 7
You didn't seed the random number generator so it always repeats the same pattern. This makes it easy to debug as you end up executing exactly the same way each time. Normally, the seed is done by:
#include <ctime>
...
srand(time(nullptr));
+ 4
What's your code? Post it up for us in the Code Playground.
https://www.sololearn.com/Codes/
+ 2
https://code.sololearn.com/ciinkVXpRYuM/?ref=app