|
the only thing i dont like about it: whenever you want to randomnize it with the same players, wouldnt it keep them in the same team? at least i think so, since the players array is sorted by the account, right?
|
I thought that as well, I was going to say something but i'm not super sure how the players are listed since everyone would have their own arrays I guess.
A way to ensure randomness would be to do something like:
PHP Code:
temp.pArr = players;
temp.teams = {0,0};
temp.toggle = 0;
while (pArr.size() > 0){
toggle =(toggle+1)%2;
temp.rInd = int(random(0,pArr.size());
temp.teams[toggle].add(pArr[rInd]);
pArr.remove(rInd);
}
But meh...