chiark / gitweb /
compute-scottish-stv: make --for-compare list winners too
[appendix-a6.git] / compute-scottish-stv
index 40a6667e4322b109be33a666c78eaf4524f5cdb9..43d3a7286f3158f8a09277aa6ca60042e9b96274 100755 (executable)
@@ -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};
     }