commit cb850e50a2111a10dfb5e50c4fd60516b648c23e
parent 823a068a43dad17198f581d7aa66e5e216754116
Author: Samir Parikh <noreply@samirparikh.com>
Date: Sat, 24 Dec 2022 16:03:44 +0000
code cleanup
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/day05/day05.pl b/day05/day05.pl
@@ -10,6 +10,7 @@ use Data::Dumper;
@ARGV = "input" unless @ARGV;
my @stacks1;
+my @stacks2;
while ( <> ) {
last if m/^ 1/;
my $stack_number = 1;
@@ -17,6 +18,7 @@ while ( <> ) {
# crates at the top of the stack will be at the end of the array
# (e.g. lower crates will be at the beginning of the array)
unshift @{ $stacks1[ $stack_number ] } => $1 if $1;
+ unshift @{ $stacks2[ $stack_number ] } => $1 if $1;
$stack_number++;
}
}