about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2019-12-10 13:39:12 +0100
committerLeah Neukirchen <leah@vuxu.org>2019-12-10 13:39:12 +0100
commitef1d5ae6393bc198ab7b8dd5ef339fb3619427cb (patch)
tree90f0474f9a5297a651b6524e6fc72cbfcd831f42
parent67303aa9611b2391b6487b155db2cbb8356fda1d (diff)
downloadadventofcode2019-ef1d5ae6393bc198ab7b8dd5ef339fb3619427cb.tar.gz
adventofcode2019-ef1d5ae6393bc198ab7b8dd5ef339fb3619427cb.tar.xz
adventofcode2019-ef1d5ae6393bc198ab7b8dd5ef339fb3619427cb.zip
day06.pl: make nicer
-rw-r--r--day06.pl7
1 files changed, 1 insertions, 6 deletions
diff --git a/day06.pl b/day06.pl
index 218531b..9c94274 100644
--- a/day06.pl
+++ b/day06.pl
@@ -3,12 +3,7 @@ use v5.16;
 
 use File::Slurper 'read_lines';
 
-my %orbits;
-
-for (read_lines("day06")) {
-    my ($in, $out) = split /\)/;
-    $orbits{$out} = $in;
-}
+my %orbits = map { reverse split /\)/ } read_lines("day06");
 
 my $p1 = 0;
 for (keys %orbits) {