def setup_players_and_matches(): testDelete() # create a tournament tourney = Tourney.create_tournament("One Hundred") for player in the_players: p_id = registerPlayer(player[1], tourney.id) player_ids.append(p_id) create_random_matches(the_players, tourney, 100)
def setup_players_and_matches(): testDelete() for player in player_list: registerPlayerSample(player[0], player[1], tourn_id=1) createRandomMatches(player_list, 100, tourn_id=1) for player in player_list_02: registerPlayerSample(player[0], player[1], tourn_id=13) createRandomMatches(player_list_02, 100, tourn_id=13)
def signUps(listOfPlayers): for player in listOfPlayers: registerPlayerUpdated(player[0], player[1], player[2],) print '==> ' + player[2] + ' registered to tournament ' + player[0] + '.' def roundOfSwiss(tournament): matches = swissPairings(tournament) if matches[0][2] == 0: byeRound = matches[0] reportMatch(tournament, byeRound[0], 0, 'win') del matches[0] for match in matches: result = random.choice(theResults) reportMatch(tournament, match[0], match[2], result) print '==> Round of Swiss complete!' # Delete Players and matches: testDelete() # Register a list of players: signUps(thePlayers) # Player some rounds using the Swiss Tournament system: roundOfSwiss('WOW') roundOfSwiss('WOW') roundOfSwiss('WOW')
registerPlayerUpdated(player[0], player[1], player[2],) print '==> ' + player[2] + ' registered to tournament ' + player[0] + '.' def roundOfSwiss(tournament): """Execute a round of the Swiss Tournament Args: tournament: """ matches = swissPairings(tournament) if matches[0][2] == 0: byeRound = matches[0] reportMatch(tournament, byeRound[0], 0, 'win') del matches[0] for match in matches: result = random.choice(theResults) reportMatch(tournament, match[0], match[2], result) print '==> Round of Swiss complete!' # Delete Players and matches testDelete() # Register a list of players. signUps(thePlayers) # Player some rounds using the Swiss Tournament system roundOfSwiss('WOW') roundOfSwiss('WOW') roundOfSwiss('WOW')
def setup_players_and_matches(): testDelete() for player in the_players: registerPlayerUpdated(player[0], player[1]) createRandomMatches(the_players, 100)
def setup_players_and_matches(): testDelete() for player in the_players: registerPlayerUpdated(player) createRandomMatches(the_players, 10)
def setup_players_and_matches(): testDelete() for player in player_list: registerPlayerSample(player[0], player[1]) createRandomMatches(player_list, 100)