@dhayden;
Each line means one voter's ranked choice from the text file.
Text file(elections.txt):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
15
-
1
2
3
-
3
2
1
-
2
1
3
-
1
2
3
-
2
3
1
|
From output:
1 2 3 4 5 6
|
Read ballot: |1 2 3|
Read ballot: 3 2 1
Read ballot: 2 1 3
Read ballot: 1 2 3
Read ballot: 2 3 1
Read 5 ballots...
|
it's ranked choice voting. Instead of choosing a single candidate, voters must rank the available candidates in the order of their choice. For example, if three candidates are available, a voter might choose #2, #1, and #3 as their choices, with #2 being their first choice, #1 the second, and #3 the third.
The outcome is determined by a runoff:
1) The first choices on all ballots are counted. If one candidate receives more than 50% of the vote, that candidate is elected.
2) If no candidate receives more than 50% of the vote, the lowest scoring candidate is eliminated (or multiple candidates if there is a tie for lowest scoring).
3) The ballots are recounted, using the highest ranking non-eliminated candidate on each ballot.
4) The process is repeated until one candidate receives more than 50% of the vote or there is a tie.