diff options
author | Matias Linares <matiaslina@gmail.com> | 2020-12-05 10:55:56 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@gmail.com> | 2020-12-05 10:55:56 -0300 |
commit | a0fcb600572ea0da9dee1b5b9e7a24ce674ebe7e (patch) | |
tree | a663ee4f6a427e98db0878ca539c9288bfbc70d0 /2017/app.p6 | |
parent | 5fa17cd54a1170449a91da48a2fe88a99349daa2 (diff) | |
download | advent-of-code-a0fcb600572ea0da9dee1b5b9e7a24ce674ebe7e.tar.gz |
Add 2018 and 2017
Diffstat (limited to '2017/app.p6')
-rwxr-xr-x | 2017/app.p6 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/2017/app.p6 b/2017/app.p6 new file mode 100755 index 0000000..1dc0ac7 --- /dev/null +++ b/2017/app.p6 @@ -0,0 +1,27 @@ +#!/usr/bin/env perl6 +use v6; +use lib 'lib'; +use AdventOfCode; + +sub MAIN($day) { + given $day { + when 1 { + my $text = 'inputs/day1'.IO.slurp; + say "Day01 a: " ~ day01($text); + say "Day01 b: " ~ day01b($text); + } + when 2 { + my @spreadsheet; + for 'inputs/day2'.IO.lines -> $line { + @spreadsheet.push($line.split(/\s+/).map(*.Int)); + } + say "Day02 a: " ~ checksum(@spreadsheet); + say "Day02 b: " ~ evenly-divisible-values(@spreadsheet); + + } + when 3 { + say "Spiral memory for 12: " ~ spiral-memory(12); + } + default { say "uninplemented"; } + } +} |