Round Robin algorithm

• 01-24-2012, 08:48 PM
ki_ha1984
Round Robin algorithm
Hello ,

I have an java array with 10 players and i want to create a tournament .
First i need the Round Robin scheduler. is there any example of Round Robin very simple in java example ??????

• 01-24-2012, 09:25 PM
ki_ha1984
Re: Round Robin algorithm
any idea ????????????????
• 01-24-2012, 09:48 PM
JosAH
Re: Round Robin algorithm
Code:

```int current= ...; int next= (current+1)%array.length;```
kind regards,

Jos
• 01-24-2012, 09:55 PM
ki_ha1984
Re: Round Robin algorithm
I didn't understand please can you explain ???

i have this array with 6 player.

static String RoundRob [] = new String[6];
how i have to do it????
• 01-24-2012, 10:17 PM
JosAH
Re: Round Robin algorithm
Quote:

Originally Posted by ki_ha1984
I didn't understand please can you explain ???

i have this array with 6 player.

static String RoundRob [] = new String[6];
how i have to do it????

Code:

```int current= ...; int next= (current+1)%RoundRob.length;```
kind regards,

Jos
• 01-24-2012, 10:28 PM
ki_ha1984
Re: Round Robin algorithm
Sorry jos but i am very new in Java the variable current what should content????
• 01-25-2012, 08:59 AM
JosAH
Re: Round Robin algorithm
Quote:

Originally Posted by ki_ha1984
Sorry jos but i am very new in Java the variable current what should content????

'current' is an index in your array and 'next' is the next index, calculated in a round robin way (i.e. the value wraps around).

kind regards,

Jos
• 01-25-2012, 08:56 PM
ki_ha1984
Re: Round Robin algorithm
thank you very much but i think that i find the solution.
i will post it when is rady.