[Tutorial] Efficient Multiple Spawning System
#11

Quote:
Originally Posted by Yashas
View Post
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
If players spawned at location X are AFK, that spot is flooded anyway.

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
So yeah, these values are pretty random...
Reply


Messages In This Thread
[Updated]Efficient Multiple Spawning System - by Yashas - 19.04.2013, 12:41
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 15:48
Re: Efficient Multiple Spawning System - by Dan.. - 19.04.2013, 16:30
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 16:51
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 16:55
Re: Efficient Multiple Spawning System - by RajatPawar - 19.04.2013, 17:04
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 17:19
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 17:25
Re: Efficient Multiple Spawning System - by Vince - 19.04.2013, 17:31
Re: Efficient Multiple Spawning System - by Yashas - 19.04.2013, 17:36
Re: Efficient Multiple Spawning System - by Dan.. - 19.04.2013, 18:30
Re: Efficient Multiple Spawning System - by mastermax7777 - 20.04.2013, 05:41
Re: Efficient Multiple Spawning System - by RajatPawar - 20.04.2013, 05:48
Re: Efficient Multiple Spawning System - by Yashas - 20.04.2013, 11:18
Re: Efficient Multiple Spawning System - by Wickeed - 13.06.2013, 12:31
Re: Efficient Multiple Spawning System - by Yashas - 22.06.2013, 15:44

Forum Jump:


Users browsing this thread: 1 Guest(s)