Browse files

Fix flickering in debug output.

  • Loading branch information...
1 parent f9a4ec2 commit 542d3dbda8515ea3dd2f3f9d976499dede1843a9 @tklein23 tklein23 committed Feb 27, 2014
Showing with 10 additions and 6 deletions.
  1. +10 −6 2014-02-27/maze-generator/genmaze.pl
View
16 2014-02-27/maze-generator/genmaze.pl
@@ -71,30 +71,34 @@ sub get_marked {
}
sub print_maze {
+ my $buf = "";
+
for (1..30) {
- print STDERR "\n";
+ $buf .= "\n";
}
my $lineno = 0;
foreach my $row (@maze) {
- printf STDERR "%2d ", $lineno;
+ $buf .= sprintf "%2d ", $lineno;
foreach my $field (@$row) {
if ($field) {
- print STDERR ".";
+ $buf .= ".";
}
else {
- print STDERR "#";
+ $buf .= "#";
}
}
- print STDERR "\n";
+ $buf .= "\n";
$lineno++;
}
+
+ print STDERR $buf;
}
push_path(0,0);
while (@path) {
- usleep(2*1000);
+ #usleep(9*1000);
print_maze();
my $p = $path[$#path];

0 comments on commit 542d3db

Please sign in to comment.