X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=appendix-a6.git;a=blobdiff_plain;f=compute-scottish-stv;h=a7fb3780d96113ab1e8921d57a2e1d60d92d7688;hp=81dc6adeafb10d553c50b2153a250a530bfc8966;hb=5aadf4171505c30873eb9c1cc0deeaa752f095be;hpb=163ff5fe92d09360697b9ca48e792e50625f5c0d diff --git a/compute-scottish-stv b/compute-scottish-stv index 81dc6ad..a7fb378 100755 --- a/compute-scottish-stv +++ b/compute-scottish-stv @@ -201,7 +201,7 @@ sub sv ($) { sub prf { my $fmt = shift; - printf "stage %d: ".$fmt, $stage, @_; + printf " ".$fmt, @_; } sub countballots () { @@ -223,7 +223,8 @@ sub computequota () { my $totalvalid = 0/1; $totalvalid += $_->{Total} foreach values %cands; $quota = floor($totalvalid / (1 + $seats) + 1); - prf "total valid %s quota %s\n", (sv $totalvalid), (sv $quota); + prf "total valid %s\n", sv $totalvalid; + prf "quota %s\n", sv $quota; } sub total_history_cmp () { @@ -311,6 +312,7 @@ $stage = 0; for (;;) { $stage++; + printf "stage %3d:\n", $stage; sortballots @allvotes if $stage == 1;