aoc2015

Advent of Code 2015 solutions in Perl.
git clone git://git.samirparikh.com/aoc2015
Log | Files | Refs | README

commit 2f53d9dadebf206a23075e14f8d913269c56c64a
parent cb71cd9906471154bbbd1e8805f981a7006d5402
Author: Samir Parikh <noreply@samirparikh.com>
Date:   Sun,  6 Nov 2022 13:26:14 +0000

clean up code

Diffstat:
Mday14/day14.pl | 4----
1 file changed, 0 insertions(+), 4 deletions(-)

diff --git a/day14/day14.pl b/day14/day14.pl @@ -5,7 +5,6 @@ use strict; use warnings; use v5.32; use List::Util qw( max ); -use Data::Dumper; @ARGV = "input" unless @ARGV; chomp( my $input = do { local $/; <> } ); @@ -16,14 +15,11 @@ my @distances; foreach ( split /\n/, $input ) { my ( $reindeer, $speed, $fly_duration, $rest_duration ) = m/(\w+) can fly (\d+) km\/s for (\d+) seconds, but then must rest for (\d+) seconds./; - say "$reindeer\t$speed\t$fly_duration\t$rest_duration"; $reindeer{ $reindeer }{ speed } = $speed; $reindeer{ $reindeer }{ fly_duration } = $fly_duration; $reindeer{ $reindeer }{ rest_duration } = $rest_duration; } -say Dumper \%reindeer; - foreach ( keys %reindeer ) { my $duration = $reindeer{ $_ }{ fly_duration } + $reindeer{ $_ }{ rest_duration };