diff options
| author | robbie-hatley <Robbie.Hatley@gmail.com> | 2024-09-26 20:53:27 -0700 |
|---|---|---|
| committer | robbie-hatley <Robbie.Hatley@gmail.com> | 2024-09-26 20:53:27 -0700 |
| commit | e44f889a41225e521919e5e3f941483bd0d259ab (patch) | |
| tree | 2c9f08f09355a9a5a57cedab04af5dd6fe857563 | |
| parent | 9feb4d34433f47049f681a5fc5f140e0adddf9b0 (diff) | |
| download | perlweeklychallenge-club-e44f889a41225e521919e5e3f941483bd0d259ab.tar.gz perlweeklychallenge-club-e44f889a41225e521919e5e3f941483bd0d259ab.tar.bz2 perlweeklychallenge-club-e44f889a41225e521919e5e3f941483bd0d259ab.zip | |
Made some tweaks to 288-2.
| -rwxr-xr-x | challenge-288/robbie-hatley/perl/ch-2.pl | 5 |
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; |
