Oh, sorry. I mean "just before every new turn." My own approach to this problem is updating the list which holds the players and ranking the players every time (with lambda) according to the points they earned and other criteria before the new turn begins BUT my issue is I don't have any idea about checking whether or not the players has played with each other before. This is critical because when a turn ends, I print the results of that turn and I have to update the points, then I update the rankings but I print according to the ranking list. If I cannot arrange the ranking list my printings will be useless. So I rank them at the beginning according to their points but not according to their previous colors or previous opponents. In order to be more clear: my dictionary is like {license number of player: [name, points, ELO, color(at the current round)]} and I also have a match record dictionary which is like {license num: [opponent's license num, color at that round, points earned at that round]} and I append the results of the next round to related key. I get the values from the first dict and rank them but as I said many times, I cannot control two qualities: whether they played before and if the player has the same color as the previous tour. So there are no problems with updating the points or rankings but I need to adjust them according to the rules: not taking the same color 3 times in a row and matching players with similar or same points if possible. I do the pairings by slicing the ranking list by 2. In this way I take 2 players if the player number is odd I control it and don't take the last one. In this step, I also have a list that holds the last player's license number because the same player cannot be idle twice. (another problem is I don't know where to use it and how to use it)Thanks for taking care and asking for details.
pairing in a list
pairing in a list
|
|
Users browsing this thread: 1 Guest(s)