chiark / gitweb /
Demonstrate bug in Graph::Undirected
[ypp-sc-tools.db-live.git] / yarrg / yppedia-chart-parser
index 068cd1c20e30694e3c56397cb1cbd976e274df82..8bcf3c9cb980b238f1255190cb41501f3e3b3896 100755 (executable)
@@ -32,8 +32,8 @@ sub error ($) {
     $errors++;
 }
 
-#open PO, ">/dev/null" or die $!;
-open PO, ">&STDOUT" or die $!;
+open PO, ">/dev/null" or die $!;
+#open PO, ">&STDOUT" or die $!;
 select(PO); $|=1;
 select(STDOUT); $|=1;
 
@@ -74,6 +74,7 @@ sub parse_yppedia_map () {
            $winode2island{$n}= $island;
            $widists->add_vertex($n);
            $wiarchs->add_vertex($n);
+print "\$g->add_vertex('$n');\n";
            printf PO "%d,%d island %s\n", $x,$y,$island;
        } elsif (($solid,$x,$y,$dirn) =
            m/^\{\{ chart\ league((?:\ solid)?) \|(\d+)\|(\d+)\|
@@ -88,6 +89,8 @@ sub parse_yppedia_map () {
 
            $widists->add_weighted_edge($nn->(), nn_xy($bx,$by), 1);
            $wiarchs->add_edge($nn->(), nn_xy($bx,$by)) if $solid;
+           $wiarchs->add_edge($nn->(), nn_xy($bx,$by)) if $solid;
+print "\$g->add_edge('".$nn->()."','".nn_xy($bx,$by)."');\n" if $solid;
 
            printf PO "%d,%d league %s %s \n", $x,$y,
                $solid?'solid':'dotted', $dirn;
@@ -179,7 +182,7 @@ sub process_yppedia_graphs () {
            next;
        }
        $wiccix2arch{$ccix}= $arch;
-       print "$ccix $arch ::\n$desc\n";
+#      print "$ccix $arch ::\n$desc\n";
     }
 }