MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / generate_bracket

Function generate_bracket

scripts/tournament_single_elim.py:157–169  ·  view source on GitHub ↗
(teams: List[Team])

Source from the content-addressed store, hash-verified

155
156
157def generate_bracket(teams: List[Team]) -> List[Team]:
158 n = len(teams)
159
160 # get the bracket by index
161 full_bracket = bracket(n)
162
163 # put the teams in the correct position in the bracket
164 sortedTeams = []
165 for i in range(n):
166 sortedTeams.append(teams[full_bracket[i] - 1])
167 logging.debug('The bracket for single elimination is...')
168 logging.debug(list(sortedTeams))
169 return sortedTeams
170
171
172def bracket(n: int):

Callers 1

run_tournamentFunction · 0.85

Calls 2

bracketFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected