Skip to content

Instantly share code, notes, and snippets.

@jzahedieh
Created November 23, 2014 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jzahedieh/b502cfca1db38d07d2bd to your computer and use it in GitHub Desktop.
Save jzahedieh/b502cfca1db38d07d2bd to your computer and use it in GitHub Desktop.
winterleague
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