Remainders Challenge, with C# Script

Nice simple bit of math to start off, 63 % 4 = 3 (63/4 = 15 r 3) so Player 4 gets to go first.

C# Script

private int rngValue = 63;
private int playerCount = 4;
private int r;
public string[] players = {"Player","One","Two","Three","Four","you go first."};


r = rngValue % playerCount;

if(r==0)
{
	System.Console.WriteLine(players[0] + " " + players[1] + " " + players[5]);
}
if(r==1)
{
	System.Console.WriteLine(players[0] + " " + players[2] + " " + players[5]);
}
if(r==2)
{
	System.Console.WriteLine(players[0] + " " + players[3] + " " + players[5]);
}
if(r==3)
{
	System.Console.WriteLine(players[0] + " " + players[4] + " " + players[5]);
}

Couldn’t find the last number given by a user, so will do 37, so with our 4 players, player 2 gets to go first (37 % 4 = 1)

A number for the next person is 104.

1 Like

Great work coding up a solution @JaylisPlay!
The central thread where everyone is chaining their answers is here: https://community.gamedev.tv/t/math-remainders-challenge/122454

I will take your number of 104 and say the remainder is 0, bcs 104/4=26 without any reminder.

So I will give of 26 as a number the the next person.

Taking 26 as the input and then dividing it by 4… I see 2 is the remainder. The number for the next person: 257

Privacy & Terms