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, ao means order matters (more games)
    • e - play the minimum number of games such that every player has played the same number of games
    • s - play the minimum games so that everyone has played at least x times, eg. s6, s243
    • g - run it in near-even groups, then take the top x for the next round etc.

    You can add l to the type, followed by a number to specify that the above chosen games should be repeated until the player in first place has a y point lead over the second, eg g4l50

Return

A dictionary of filename: points value pairs.


Note: this function has not been fully implemented yet