chiark / gitweb /
graphviz: label the winning node(s)
[appendix-a6.git] / compute
diff --git a/compute b/compute
index 7c70079a3e4707906affa1cb76d7fd2a36c65b2d..58b3587d69cc216827e8e7a1f23987f0aae51c60 100755 (executable)
--- a/compute
+++ b/compute
@@ -408,10 +408,13 @@ for (;;) {
 print "no defeats within the Schwartz set\n";
 print "final schwartz set:\n\n";
 
+my $winxlabel;
 if ($schwartz->vertices() == 1) {
     print "WINNER IS:\n";
+    $winxlabel = "winner";
 } else {
     print "WINNER IS ONE OF (CASTING VOTE DECIDES):\n";
+    $winxlabel = "potential winner";
 }
 
 printf "    %-5s %s\n", $_, $choices{$_}{Desc}
@@ -424,6 +427,9 @@ if (defined $gfile) {
        if ($cho->{Dropped}) {
            $label .= "\nDropped: $cho->{Dropped}";
        }
+       if ($schwartz->has_vertex($chn)) {
+           $label .= "\n$winxlabel";
+       }
        $showg->set_vertex_attribute($chn, 'label', $label);
     }