X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=appendix-a6.git;a=blobdiff_plain;f=stv;h=3c6160e979f27ffa7f026ed59d20a4b2dabf2710;hp=68940f452683825259efcecc5fdc2fffbb7c3a38;hb=2251d06cbf7d16682040782d415c371a43fdf275;hpb=bf778012959670ef232a8b107ceb508296082465 diff --git a/stv b/stv index 68940f4..3c6160e 100755 --- a/stv +++ b/stv @@ -3,6 +3,19 @@ # Does STV according to # http://www.rosenstiel.co.uk/stvrules/av/index.htm +# Usage: +# ./stv [TIEBREAK ...] PLACES [INPUT-FILES ...] +# +# PLACES is the number of seats to be filled +# +# INPUT-FILES are in the format: +# VOTER PQRST +# where P, Q, R, etc. are candidates. Candidates +# must be single letters. +# +# Each TIEBREAK is +# P,Q,... + use strict; use utf8; use autodie; @@ -398,4 +411,14 @@ for (;;) { push @unsorted, @$votes; } +open VL, ">.stv.votes" or die $!; +foreach my $vote (@allvotes) { + print VL "----------------------------------------\n"; + print VL "voter $vote->{Voter}\n"; + print VL "prefs ". (join " ", @{ $vote->{Prefs} }). "\n"; + print VL $_, "\n" foreach @{ $vote->{Log} }; +} +print VL "========================================\n"; +close VL; + print "done.\n";