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:
74893eb
)
compute-scottish-stv: make --for-compare list winners too
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 23 Aug 2016 12:46:39 +0000
(13:46 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 23 Aug 2016 12:46:39 +0000
(13:46 +0100)
compute-scottish-stv
patch
|
blob
|
history
diff --git
a/compute-scottish-stv
b/compute-scottish-stv
index 40a6667e4322b109be33a666c78eaf4524f5cdb9..43d3a7286f3158f8a09277aa6ca60042e9b96274 100755
(executable)
--- a/
compute-scottish-stv
+++ b/
compute-scottish-stv
@@
-220,6
+220,12
@@
sub countballots () {
push @pr, $c;
}
+ if ($for_compare) {
+ # for comparison with OpenSTV, which always prints
+ # the quota for every elected candidate
+ push @pr, { %$_, Total => $quota } foreach @elected;
+ }
+
foreach my $c (reverse sort $display_cmp @pr) {
prf "candidate %-10s: %s votes\n", $c->{Cand}, sv $c->{Total};
}