Init simplest possible round robin function
This commit is contained in:
parent
4f5b173439
commit
436f1ac199
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.venv
|
11
round_robin.py
Normal file
11
round_robin.py
Normal 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]}")
|
Loading…
Reference in New Issue
Block a user