chiark / gitweb /
compute-scottish-stv: format output for slightly easier comparison
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 23 Aug 2016 12:13:51 +0000 (13:13 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 23 Aug 2016 12:13:51 +0000 (13:13 +0100)
compute-scottish-stv

index 81dc6adeafb10d553c50b2153a250a530bfc8966..a7fb3780d96113ab1e8921d57a2e1d60d92d7688 100755 (executable)
@@ -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;