19.04.2013, 18:30
Quote:
Awesome!
Random might give same numbers or some one number may come rare and another gets to be very common. But my system gives in an order and all get equal number of times whereas in your case few come many times some may even repeat.Yours might be faster than mine but mine does it without any chance of repetitions nor flooding of players in one place. Anyway thanks I will use your snippet somewhere |
pawn Code:
main() {
new r[10];
for (new i = 0; i != 200000; ++i) {
++r[random(10)];
}
for (new i = 0; i != 10; ++i) {
printf("%d %d", i, r[i]);
}
}
Code:
0 20087 1 19945 2 19838 3 20122 4 19882 5 20016 6 20165 7 20117 8 20022 9 19806