Does anyone know how to generate a large array of random numbers from 100 or more repetitions. For example, I need to generate 100 times from 1 to 6 to simulate a dice roll. But when I repeat the cast more than 70 times it gives wrong values. I'm trying QRandomGenerator.system() And std::random, but that doesn't help. I also tried to do Sleep(1) every 50 throws.
long roll_D6(){
QRandomGenerator generator;
return (generator.system()->generate() % 6) + 1;
}
// other func
long current = 0;
for(size_t i = 0; i < 100; i++){
current+=roll_D6();
}
Aucun commentaire:
Enregistrer un commentaire