tbscope:
this: 10 10 10 10 11 15 21 21 21 21 21
Added after 28 minutes:
high_flyer: "you need a new seed for each new random set. use void qsrand ( uint seed ). If you have read qrand() doc, you would have known it."
I'm using qsrand. See the function: randInt2
I found this in other forums that spoke the same problem.
"What you see is the effect of pseudo-randomness. You seed it with the time once, and it generates a sequence of numbers. Since you are pulling a series of random numbers very quickly after each other, you are re-seeding the randomizer with the same number until the next millisecond. And while a millisecond seems like a short time, consider the amount of calculations you're doing in that time."
"If you make the call fast enough the value of QTime::currentTime().msec() will not change, and you're basically re-seeding qsrand with the same seed, causing the next random number generated to be the same as the prior one."
I think I need something faster than milliseconds, maybe the CPU clock cycles.
Is there any solution to this problem?
Bookmarks