I am trying to figure out how to print out a schedule for a 8 player tournament. We have a golf league at work that has 8 players. Each player must play one another only once. I have done some research and taken a guess it probably will use permutation or recursion. I am very new to C++ and thought this would be a fun exercise, boy was I wrong. I am stumped, I am not sure where to begin. If any one could point me in the right direction, I would appreciate it.
Thanks for your time,
Brad
While you can solution by yourself, you must not depended on the computer!
Meanwhile the problem is just a easy problem that you can solve it quickly if you had learned the math!
The first for loop will go through all the players. The second one will go to the player after the "i" is untill the last player. So you will have all the possible cobinations of 2 players without repeating the same combiation.
thanks for all the reply's. I will try to figure it out on paper. Mitsakos, thanks for the code. I guess I should of stated that the tournament is 7 weeks, so I was trying to output matches for each week.
Like week 1:
1-2
3-4
5-6
7-8
Week 2:
...