diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d17dae --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.venv diff --git a/round_robin.py b/round_robin.py new file mode 100644 index 0000000..1aa320b --- /dev/null +++ b/round_robin.py @@ -0,0 +1,11 @@ +# take a list of teams +# return a round-robin schedule + +teams = ["Team A", "Team B", "Team C", "Team D", "Team E", "Team F", "Team G", "Team H", "Team I", "Team J"] + +# each round should have len(teams)//2 matches, as that should appropriately handle odd-numbered team counts + +for r in range(1,len(teams)): + print("Round", r) + for i in range(0,len(teams)//2): + print(f"{teams[i]} vs. {teams[i-r]}")