I have a mathematical problem in my JavaScript code. I need to divide a given number of players into 2 teams randomly so that each time – if players want to play again – the
For the even cases, just pick numbers you haven't used randomly and make teams.
For the odd cases, pick a number randomly to sit out. Then the remaining numbers are like an even case.