I am designing an application for a team cow sorting competition. For those of you who don't know what that is, I'll have to explain it some other time. This competition is for 2-man teams. We do a round robin competition in which each man is paired once with each other man. If there are 15 men, each man will ride a total of 14 times. I have an application in which a database list of single names will automatically create a second database of paired 2-man teams. A list of 15 men will create a total of 105 teams. Now keep in mind that my example is for 15 men, but will vary, might be 5, might be 25 riders or any other number. I have a field that assigns each man a number, starting at 1 through however many men there are. Another field numbers the teams. Team 1 would consist of rider 1 + rider 2, team 2 would consist of rider 1 + rider 3 and continue on until team 105 (based on 15 riders) would end up constisting of rider 14 + rider 15. This part works fine. Here is where I need help. I need to auto arrange the teams in an order they will ride, in which each man is spaced out evenly so no man will have to ride back to back or even close, so not to tire out their horses any more than any other. I have another field that assigns a ride number that would start at 1 through the total number of teams. I need a formula or some sort of pattern that would automatically do this. Ideally, the order would go something like this. The first team to ride would be riders 1+2, then riders 3+4, 5+6, 7+8, 9+10, 11+12, 13+14, 15+1, 2+3,4+5, 6+7, 8+9, 10+11, 12+13, 14+15....... I accomplished this so far by setting script variable %rider1 to 1 and %rider2 to 2 which set my first team to ride were riders 1+2. I then ran a script that added 2 to both script variables and then looped it to run again, setting my second team to ride to riders 3+4. I added an "if" statement that if %rider1 or %rider2 exeded the total number of riders to start over. After team 13+14, it went to 15+1 then 2+3 and so on. Now here came the problem. Using this pattern, after 14+15, by adding 2, it would go back to 1+2, which was already the first team to ride. I guess after 14+15, next should be 1+3, 2+4, then 5+7, 6+8, 9+11, 10+12, 13+15, 14+1,then 2+5, 3+6, 4+7, then 8+10, 9+11, 12+14, 13+1, 15+2 and so on. As you can see the pattern keeps changing. I know I am probably making this more difficult than it should be. Can anyone come up with a solution where I can arrange these automatically at the touch of a key. As you can see it is an ordeal to arrange this manually. Also dont forget that the number of riders vary. It changes things a little when there an even or an odd number of riders. Any help or comments would be greatly appreciated.
Thanks,
Bobby
Thanks,
Bobby
Comment