- Parent Category: Programming Assignments' Solutions
We Helped With This Python Programming Homework: Have A Similar One?
|More Info||Python Programming Help|
Assignment # 7:
1. Create a new module named, task7.py.
2. Create a function named matchmaking() that takes four parameters, in order:
1. players (list): a list of tuples of usernames and connection strength for each user.
2. teams (int, optional): The number of teams to build for this game, defaults to 3
3. min_team (int, optional): The minimum number of players per team, defaults to 1.
4. max_team (int, optional): The maximum number of players per team, defaults to None. 3.
3. The matchmaking() function should filter out players with bad connections and produce the lists of players, segregated into the appropriate teams, eg:
Where players 1 and 3 are on the same team and players 2 and 4 are on the same team.
4. If there are not enough players with good connections to meet the specified number of teams and the minimum size of each team the function should return False, otherwise, a list of lists as above.
5. Players should be distributed in a round-robin fashion, eg, in a game with four teams, the first team would consist of players 1, 5, 9, etc while the second team would consist of players 2, 6, 10, etc and so-on.
6. All teams should have the exact same number of
players. In cases where there are more players than can be evenly distributed
across all teams, the excess players should not be assigned to a team.
7. Work should be broken up into at least two (2) functions. Students may decide which component of the work they would like to break out into the second function