Challenge
Four Player Game
We need to find out which player to go first.
Players = 4 or 0,1,2,3
Using the random number 63 who goes first?
63 % 4 = 15 (15x4=60) r3 = 3+1 = Player 4 (Due to starting at 0)
switch( rand % 4 )
{
default:
case 0:
// Player 1
break;
case 1:
// Player 2
break;
case 2:
// Player 3
break;
case 3:
// Player 4
break;
}
I got: 222
222 % 4 = 55 r 2
2+1 = Player 3
Next Player: 91