From: Ben Harris Date: Wed, 8 May 2024 13:37:29 +0000 (+0100) Subject: 08: explicitly construct rotations as powers of ⌽∘⍉ X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=3952084df57eb132fb6535e9c1450e7d2d016433;p=aoc-2022.git 08: explicitly construct rotations as powers of ⌽∘⍉ --- diff --git a/08/08a.bqn b/08/08a.bqn index ea65018..95f6429 100644 --- a/08/08a.bqn +++ b/08/08a.bqn @@ -1,4 +1,4 @@ Main←{𝕊in: - +´⥊∨´{{∊⌈`𝕩}˘⌾𝕏in}¨⟨⊢,⌽⍉,⌽⌽˘,⍉⌽⟩ + +´⥊∨´{{∊⌈`𝕩}˘⌾𝕏in}¨{⌽∘⍉⍟𝕩}¨↕4 } •Show Main '0'-˜>•file.Lines ⊑•args diff --git a/08/08b.bqn b/08/08b.bqn index d2021a0..d1d204c 100644 --- a/08/08b.bqn +++ b/08/08b.bqn @@ -1,5 +1,5 @@ Main←{𝕊in: DirScores←{>{+˝((1↓≢𝕩)⥊1)»∧`(⊏𝕩)⊸>˘1↓𝕩}¨¯1↓↓𝕩} - ⌈´⥊×´{DirScores⌾𝕏in}¨⟨⊢,⌽⍉,⌽⌽˘,⍉⌽⟩ + ⌈´⥊×´{DirScores⌾𝕏in}¨{⌽∘⍉⍟𝕩}¨↕4 } •Show Main '0'-˜>•file.Lines ⊑•args