% is the symbol for modular division.
It basically works but...urghh I suck at explaining it, have a wiki: http://en.wikipedia.org/wiki/Modulo_operation
But basically it's allowing the variable to pick between to the 2 teams swapping back and fourth.
temp.count=0:0%2 = element 0 = team 1
temp.count = 1:1%2 = element 1 = team 2
temp.count = 2:2%2=0 = element 0 = team 1
temp.count = 3:3%2 = 1 = element 1 = team 2
and so on. It's a really nice solution btw emera.
|
Thanks

And thanks for the nice explanation. Mine would've sucked.