From cf1fe41d4fc13725f15adfe7a8ca4094adb70a80 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Wed, 11 Dec 2019 22:29:21 +0100 Subject: day10 (part1 only) --- day10.pl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 day10.pl diff --git a/day10.pl b/day10.pl new file mode 100644 index 0000000..5061bcd --- /dev/null +++ b/day10.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl -w +use v5.16; + +use File::Slurper 'read_lines'; +use List::Util qw'max uniq'; +use Math::Complex; + +my @as; +my @l = read_lines('day10t'); +while (my ($x, $l) = each(@l)) { + my @c = split('', $l); + while (my ($y, $c) = each(@c)) { + push @as, cplx($x, $y) if $c eq "#"; + } +} + +say max map { my $a = $_; scalar uniq map { arg($a - $_) } @as } @as; +# 288 + +# Part 2 TBD +# 616 -- cgit 1.4.1