chiark
/
gitweb
/
~ian
/
appendix-a6.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4cd1697
)
compute-scottish-stv: sort countballots output
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 21 Aug 2016 20:12:29 +0000
(21:12 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 21 Aug 2016 20:12:29 +0000
(21:12 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
compute-scottish-stv
patch
|
blob
|
history
diff --git
a/compute-scottish-stv
b/compute-scottish-stv
index 575f10ed4f5275812acc8dcf3493f0f5b3326653..4715808de5057be8fcc5bb30f59ca19c3080df58 100755
(executable)
--- a/
compute-scottish-stv
+++ b/
compute-scottish-stv
@@
-155,9
+155,12
@@
sub countballots () {
next if $c->{NonCont};
$c->{Total} = 0;
$c->{Total} += $_->{Weight} foreach @{ $c->{Votes} };
- prf "candidate %-10s: %10s votes\n", $cand, $c->{Total};
$c->{History}[$stage-1] = $c->{Total};
}
+
+ foreach my $c (reverse sort total_history_cmp values %cands) {
+ prf "candidate %-10s: %10s votes\n", $c->{Cand}, $c->{Total};
+ }
}
sub computequota () {