Commits

Anonymous committed f5dde3c

Convert to a more user-friendly layout-as-string output.

Comments (0)

Files changed (1)

abc-path/generator/generate-abs-path.pl

     die "Not found!";
 }
 
+sub get_layout_as_string
+{
+    my ($self, $l) = @_;
+
+    my $render_row = sub {
+        my $row = shift;
+
+        return join(" | ", map { defined($_) ? $_ : '*' } @$row);
+    };
+
+    return join('', map { $render_row->($_) . "\n" } @$l);
+}
+
 package main;
 
 use strict;
 
 my $gen = Games::ABC_Path::Generator->new({ seed => 24 });
 
-print Dumper($gen->generate());
+print $gen->get_layout_as_string($gen->generate());