Assigning the number to a player
#1

Let's say I have numbers: 0, 1, 2, 3, 4.
And there are 3 players. Each of those numbers must be assigned to each player randomly, but NOT THE SAME. How?
Maybe there's an algorythm to do such things...? Hope you understood me.
Reply
#2

Put them in an array, shuffle the array and then assign sequentially. Here's an implementation in C++, but shouldn't be too hard to adapt to Pawn: http://www.geeksforgeeks.org/shuffle-a-given-array/
Reply
#3

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)