From: Ian Jackson Date: Mon, 1 Aug 2016 15:37:53 +0000 (+0100) Subject: stv: fix rats, more output X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=2c0d1b163477f5472ca5f2495f5f436d5205889f;p=appendix-a6.git stv: fix rats, more output --- diff --git a/stv b/stv index 111b2bd..ba89fce 100755 --- a/stv +++ b/stv @@ -84,7 +84,7 @@ sub equalpiles ($@) { return () unless @sorted; my $s = $sorted[0]; my $eqtotal = $s->{Total}; - my $count = 0; + my $count = 0/1; while ($count < @sorted && $sorted[$count]{Total} == $eqtotal) { printf "%7s %10s %s\n", $how, $sorted[$count]{Cand}, pr $sorted[$count]{Total}; @@ -155,7 +155,7 @@ for (;;) { } foreach my $firstpref (sort keys %sorted) { foreach my $vote (@{ $sorted{$firstpref}{Votes} }) { - votelog $vote, "counted $vote->{Weight} for $firstpref"; + votelog $vote, "counted for $firstpref ".pr $vote->{Weight}; } } my @sorted; @@ -171,7 +171,7 @@ for (;;) { push @stagerecord, { map { ($_->{Cand}, $_->{Total}) } @sorted }; - my $totalvalid = 0; + my $totalvalid = 0/1; my $countvalid = sub { my ($l, $what) = @_; foreach my $s (@$l) { @@ -259,7 +259,7 @@ for (;;) { # Look for people to eliminate # We eliminate before trying to transfer surpluses # ERS 5.2.5 - my $elimvotebefore = 0; + my $elimvotebefore = 0/1; for (;;) { last unless @sorted;