tournament(...) - ArtemisFowlJnr/KotH GitHub Wiki
Syntax
def tournament(bots, game, per_game=[2], t_type='ao'):
-
bots- a list of bots to compete -
game- a game function, to be passed a list of bots an return a dictionary, list or string. A string represents the filename of the winning bot, a list the order in which the bots came (best first) and a dictionary should contain filename: score value pairs. -
per_game- an iterable containing all valid numbers of bots to take part in a game -
t_type- the type of tournament. Theis should be:a- play a game with every possible combination of bots,aomeans order matters (more games)e- play the minimum number of games such that every player has played the same number of gamess- play the minimum games so that everyone has played at leastxtimes, eg.s6,s243g- run it in near-even groups, then take the topxfor the next round etc.
You can add
lto the type, followed by a number to specify that the above chosen games should be repeated until the player in first place has aypoint lead over the second, egg4l50
Return
A dictionary of filename: points value pairs.
Note: this function has not been fully implemented yet