chiark / gitweb /
graphviz: label the winning node(s)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 6 Feb 2014 00:56:52 +0000 (00:56 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 6 Feb 2014 00:56:52 +0000 (00:56 +0000)
compute

diff --git a/compute b/compute
index 7c70079..58b3587 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);
     }