Created
March 6, 2019 14:19
-
-
Save uberswe/cc8d63c74aeab5a8172c7421faed8677 to your computer and use it in GitHub Desktop.
Group tournament game generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Keep first position while rotating rest of array | |
[home teams] | |
1,2 | |
3,4 | |
[away teams] | |
1,3 | |
4,2 | |
1,4 | |
2,3 | |
If teams should meet more than once switch home and away sides | |
[home teams] | |
4,3 | |
2,1 | |
[away teams] | |
2,4 | |
3,1 | |
3,2 | |
4,1 | |
I reverse the array and hold the last element but it is probably more logical to simply | |
switch which side is home or away now that I look at it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment