commit 3b897b6c1c52a813737c78f2b4effa7632944bf3
parent b2f85e677c6134f90768e1f28d9101f576c8b44a
Author: mpizzzle <m@michaelpercival.xyz>
Date: Sun, 12 Dec 2021 21:40:04 +0000
puzzle 6 part 1 complete
Diffstat:
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/2021/files/6.txt b/2021/files/6.txt
@@ -0,0 +1 @@
+4,3,4,5,2,1,1,5,5,3,3,1,5,1,4,2,2,3,1,5,1,4,1,2,3,4,1,4,1,5,2,1,1,3,3,5,1,1,1,1,4,5,1,2,1,2,1,1,1,5,3,3,1,1,1,1,2,4,2,1,2,3,2,5,3,5,3,1,5,4,5,4,4,4,1,1,2,1,3,1,1,4,2,1,2,1,2,5,4,2,4,2,2,4,2,2,5,1,2,1,2,1,4,4,4,3,2,1,2,4,3,5,1,1,3,4,2,3,3,5,3,1,4,1,1,1,1,2,3,2,1,1,5,5,1,5,2,1,4,4,4,3,2,2,1,2,1,5,1,4,4,1,1,4,1,4,2,4,3,1,4,1,4,2,1,5,1,1,1,3,2,4,1,1,4,1,4,3,1,5,3,3,3,4,1,1,3,1,3,4,1,4,5,1,4,1,2,2,1,3,3,5,3,2,5,1,1,5,1,5,1,4,4,3,1,5,5,2,2,4,1,1,2,1,2,1,4,3,5,5,2,3,4,1,4,2,4,4,1,4,1,1,4,2,4,1,2,1,1,1,1,1,1,3,1,3,3,1,1,1,1,3,2,3,5,4,2,4,3,1,5,3,1,1,1,2,1,4,4,5,1,5,1,1,1,2,2,4,1,4,5,2,4,5,2,2,2,5,4,4
diff --git a/2021/puzzle_6.apl b/2021/puzzle_6.apl
@@ -0,0 +1,8 @@
+#! /usr/bin/apl --script
+
+input← ⍎'3,4,3,1,2'
+input← 300 ⍴ ⊃ ⍎⎕FIO[49] 'files/6.txt'
+
+⍴ { (c↓ d),⍨ 7 | d↑⍨ c← +/7<⍨ d← 1-⍨⍵ ,9/⍨+/0=⍵ } ⍣ 80 input ⍝ part 1
+
+)OFF