# Thread: Round Robin algorithm

1. Senior Member
Join Date
Aug 2011
Posts
108
Rep Power
0

## 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 ??????

Thank you in advanced.

2. Senior Member
Join Date
Aug 2011
Posts
108
Rep Power
0

## Re: Round Robin algorithm

any idea ????????????????

3. ## Re: Round Robin algorithm

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

Jos

4. Senior Member
Join Date
Aug 2011
Posts
108
Rep Power
0

## 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????

5. ## Re: Round Robin algorithm

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????

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

Jos

6. Senior Member
Join Date
Aug 2011
Posts
108
Rep Power
0

## Re: Round Robin algorithm

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

7. ## Re: Round Robin algorithm

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

8. Senior Member
Join Date
Aug 2011
Posts
108
Rep Power
0

## Re: Round Robin algorithm

thank you very much but i think that i find the solution.
i will post it when is rady.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•