Round Robin Tournament C#
I am trying to generate a round robin tournament schedule for an even number of teams in c sharp.
I was thinking of using an array but I am having a little trouble getting it to work. I want the first team to remain fixed, so I was just thinking of using an int for this t开发者_JAVA技巧eam. Then I want the array to rotate, so that the fixed int will pair up with the first element in the array and all of the remaining elements will pair up together like this:
- int Team1 vs array[0]
- array[1] vs array[2]
- array[3] vs array[4]
- array[5] vs array[6]
etc. and then rotate so that Team1 plays against each member of the array and they all play each other as well. Thanks for any help you can provide!
For a round robin, you want to choose combinations of length two (without repetition) from the list of teams.
精彩评论