Mar-11-2022, 05:23 PM
(This post was last modified: Mar-11-2022, 05:24 PM by deanhystad.)
With Catalog only, weighted and random are the same because all games have the same number of votes.
You can also do dad, thing 1 and catalog to pick a game that is more likely on your lists, but still have the possibility of picking a game that is not.
With a slight modification you can see the voting:
You can also do dad, thing 1 and catalog to pick a game that is more likely on your lists, but still have the possibility of picking a game that is not.
With a slight modification you can see the voting:
@classmethod def cast_ballots(cls, gamers): """Collect votes from gamers""" ballots = [] for gamer in gamers: ballots += cls.Gamers[gamer].votes() print("Weighted choices for", ", ".join(gamers)) for game in collections.Counter(ballots).most_common()[:5]: print(f"{game[0]:10} {100*game[1] / len(ballots):>6.2f}%") return ballots
Output:Weighted choices for Mom, Dad, Thing 1, Thing 2
Uno 24.53%
Monopoly 15.09%
Life 13.21%
Skippo 13.21%
COD 9.43%