chiark
/
gitweb
/
~bjharris
/
aoc-2022.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b745a5
)
08: explicitly construct rotations as powers of ⌽∘⍉
author
Ben Harris
<bjh21@bjh21.me.uk>
Wed, 8 May 2024 13:37:29 +0000
(14:37 +0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Wed, 8 May 2024 13:37:29 +0000
(14:37 +0100)
08/08a.bqn
patch
|
blob
|
history
08/08b.bqn
patch
|
blob
|
history
diff --git
a/08/08a.bqn
b/08/08a.bqn
index ea6501838826928c75c9a6f0ad721f253a8f3781..95f6429817e114a7f173a5e11e24a16584c2c8f1 100644
(file)
--- 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 d2021a082222517e5ff98ae46f7560e50cf8ad49..d1d204c3d7b0a7ff4f2253f751574bb74b11fdbb 100644
(file)
--- 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