aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-288/robbie-hatley/perl/ch-2.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/challenge-288/robbie-hatley/perl/ch-2.pl b/challenge-288/robbie-hatley/perl/ch-2.pl
index 2159834b6e..4007dff681 100755
--- a/challenge-288/robbie-hatley/perl/ch-2.pl
+++ b/challenge-288/robbie-hatley/perl/ch-2.pl
@@ -152,7 +152,8 @@ sub max_contiguous_block_size ($mref) {
# If we get to here, current AND neighbor already have block numbers.
# If they're the same, take no action:
next if $ids{$ne} == $ids{$id};
- # Otherwise, assign the neighbor's block number to all cells with the current block number:
+ # Otherwise, assign the neighbor's block number to all cells with the current block number,
+ # thus merging the two blocks:
for my $key (keys %ids) {
if ($ids{$key} == $ids{$id}) {$ids{$key} = $ids{$ne};}
}
@@ -197,7 +198,7 @@ my @matrices = @ARGV ? eval($ARGV[0]) :
# ------------------------------------------------------------------------------------------------------------
# MAIN BODY OF PROGRAM:
-$"=', ';
+$"=' ';
for my $mref (@matrices) {
say '';
my @matrix = @$mref;