Init simplest possible round robin function

This commit is contained in:
Joey Hafner 2024-02-13 00:43:23 -08:00
parent 4f5b173439
commit 436f1ac199
2 changed files with 12 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.venv

11
round_robin.py Normal file
View File

@ -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]}")