aoc2022

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

day12.pl (373B) - raw


      1 #!/usr/local/bin/perl
      2 # day 2022-12
      3 
      4 use strict;
      5 use warnings;
      6 use v5.32;
      7 use lib '.';
      8 use Day12 qw( define_matrix define_graph find_path );
      9 
     10 @ARGV = "input" unless @ARGV;
     11 chomp( my $input = do { local $/; <> } );
     12 
     13 my $matrix = define_matrix( $input );
     14 my ( $neighbors, $elevation ) = define_graph( $matrix );
     15 my $part_1 = find_path( $neighbors, $elevation );
     16 say $part_1;