Skip to content

Instantly share code, notes, and snippets.

@uberswe
Created March 6, 2019 14:19
Show Gist options
  • Save uberswe/cc8d63c74aeab5a8172c7421faed8677 to your computer and use it in GitHub Desktop.
Save uberswe/cc8d63c74aeab5a8172c7421faed8677 to your computer and use it in GitHub Desktop.
Group tournament game generation
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