adventofcode/2024/10/Solution.pm

41 lines
543 B
Perl
Raw Normal View History

2024-12-10 23:34:16 +00:00
use 5.36.0;
package Solution;
use Moo;
use Path::Tiny;
has file => ( is => 'ro' );
has path_file => (
is => 'lazy',
default => sub ($self) {
path( $self->file );
}
);
sub day_part ($self) {
$self =~ /Part(\d)/g;
return $1;
}
sub file_lines ($self) {
$self->path_file->lines( { chomp => 1 } );
}
sub file_slurp ($self) {
my $content = $self->path_file->slurp;
chomp $content;
return $content;
}
has input => (
is => 'lazy',
default => sub { ... }
);
sub solve { ... }
1;