Open Sjan1 opened 4 months ago
It's not alphabetical. It's simply the last candidate, since it is using rev(sort(total))[1:nseats]
to get the totals in a decreasing order.
While the function works the way it should, which is reassuring, I find the behaviour misleading. When the two candidates reach the same number of votes, it would be fair to win for both of them. And print a message of why it happened.
In the following example, "APE" wins, while the number of votes equals. Is the winner determined alphabetically?
Results of Plurality voting ===========================
Number of valid votes: 8 Number of invalid votes: 0 Number of candidates: 2 Number of seats: 1
Elected: APE