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:
163ff5f
)
compute-scottish-stv: format output for slightly easier comparison
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 23 Aug 2016 12:13:51 +0000
(13:13 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 23 Aug 2016 12:13:51 +0000
(13:13 +0100)
compute-scottish-stv
patch
|
blob
|
history
diff --git
a/compute-scottish-stv
b/compute-scottish-stv
index 81dc6adeafb10d553c50b2153a250a530bfc8966..a7fb3780d96113ab1e8921d57a2e1d60d92d7688 100755
(executable)
--- a/
compute-scottish-stv
+++ b/
compute-scottish-stv
@@
-201,7
+201,7
@@
sub sv ($) {
sub prf {
my $fmt = shift;
sub prf {
my $fmt = shift;
- printf "
stage %d: ".$fmt, $stage
, @_;
+ printf "
".$fmt
, @_;
}
sub countballots () {
}
sub countballots () {
@@
-223,7
+223,8
@@
sub computequota () {
my $totalvalid = 0/1;
$totalvalid += $_->{Total} foreach values %cands;
$quota = floor($totalvalid / (1 + $seats) + 1);
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 () {
}
sub total_history_cmp () {
@@
-311,6
+312,7
@@
$stage = 0;
for (;;) {
$stage++;
for (;;) {
$stage++;
+ printf "stage %3d:\n", $stage;
sortballots @allvotes if $stage == 1;
sortballots @allvotes if $stage == 1;