From df6a180b91dc1a3b7f725175bc023aef47aed8ba Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sun, 17 Dec 2017 11:39:52 -0500 Subject: [PATCH] part1 --- 17/1.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 17/1.pl diff --git a/17/1.pl b/17/1.pl new file mode 100644 index 0000000..8640c57 --- /dev/null +++ b/17/1.pl @@ -0,0 +1,14 @@ +use 5.20.0; + +my $i = 380; + +my @v = (0); +my $p = 0; + +use DDP; +for(1..2017) { + $p = ( 1 + $p + $i ) % @v; + splice @v, $p, 0, $_; +} + +p @v;