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

Function bracket

scripts/tournament_single_elim.py:172–180  ·  view source on GitHub ↗
(n: int)

Source from the content-addressed store, hash-verified

170
171
172def bracket(n: int):
173 if (n == 1):
174 return [1]
175 half_bracket = bracket(int(n / 2))
176 full_bracket = n * [0]
177 for i in range(int(n / 2)):
178 full_bracket[2 * i] = half_bracket[i]
179 full_bracket[2 * i + 1] = n + 1 - full_bracket[2 * i]
180 return full_bracket
181
182
183def wait_for_empty_queue(conn) -> None:

Callers 1

generate_bracketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected