Created
November 23, 2014 21:16
-
-
Save jzahedieh/b502cfca1db38d07d2bd to your computer and use it in GitHub Desktop.
winterleague
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
import itertools | |
# given I have a list from 1-16 | |
# group evenly balanced pairs | |
players = list(range(1, 13)) | |
N = 4 | |
groupNo = len(players) / 4 | |
print(groupNo) | |
print(players) | |
# group players into 4s | |
groups = [players[n:n+N] for n in range(0, len(players), N)] | |
print(groups) | |
quit() | |
unqiue_pairs = itertools.permutations(players, 2) | |
unique_matches = itertools.permutations(unqiue_pairs, 2) | |
for ab in unique_matches: | |
print(ab) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment