chiark / gitweb /
wip
[appendix-a6.git] / parse
diff --git a/parse b/parse
index 90f46fe82a97a04e8c81e6ed2a487dde9163064e..c9ebc344c98c4afa200f424d2ba208c3bc918830 100755 (executable)
--- a/parse
+++ b/parse
@@ -75,5 +75,34 @@ foreach my $iv (@invotes) {
     die "voter $voter $@" if $@;
 }
 
-p %choices;
-p @vab;
+foreach my $iy (-2..$#choices) {
+    foreach my $ix (-2..$#choices) {
+       if ($iy==-1) {
+           if ($ix==-1) {
+               printf "+" or die;
+           } else {
+               printf "------" or die;
+           }
+       } elsif ($ix==-1) {
+           printf "|" or die;
+       } elsif ($ix==-2 && $iy==-2) {
+           printf "V(Y,X)" or die;
+       } elsif ($iy==-2) {
+           printf "%5s ", $choices[$ix] or die $!;
+       } elsif ($ix==-2) {
+           printf "%5s ", $choices[$iy] or die $!;
+       } else {
+           my $v = \( $vab[$iy][$ix] );
+           $$v += 0;
+           if ($$v) {
+               printf "%5d ", $$v or die $!;
+           } else {
+               printf "%5s ", "" or die $!;
+           }
+       }
+    }
+    printf "\n" or die $!;
+}
+
+#p %choices;
+#p @vab;