From: Ian Jackson Date: Sun, 21 Aug 2016 20:12:29 +0000 (+0100) Subject: compute-scottish-stv: sort countballots output X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=appendix-a6.git;a=commitdiff_plain;h=2251d06cbf7d16682040782d415c371a43fdf275;hp=4cd1697174e964f23d0ad06faaa2bcd24288d174 compute-scottish-stv: sort countballots output Signed-off-by: Ian Jackson --- diff --git a/compute-scottish-stv b/compute-scottish-stv index 575f10e..4715808 100755 --- 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 () {