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:
c207390
)
25a done
main
author
Ben Harris
<bjh21@bjh21.me.uk>
Fri, 14 Jun 2024 23:34:48 +0000
(
00:34
+0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Fri, 14 Jun 2024 23:34:48 +0000
(
00:34
+0100)
There is no 25b.
25/25a.bqn
patch
|
blob
|
history
diff --git
a/25/25a.bqn
b/25/25a.bqn
index 6b27ef81f1c3828ca4e3efd00a92df0524924f10..18d713e870016badb8895a479dc297b700684b7f 100644
(file)
--- a/
25/25a.bqn
+++ b/
25/25a.bqn
@@
-1,2
+1,6
@@
-UnSnafu←{ +´(¯2+"=-012"⊐𝕩)×({5⋆𝕩}¨⌽↕≠𝕩) }
-•Show +´UnSnafu¨•file.Lines ⊑•args
+Snafu←{
+ 𝕊0: "";
+ 𝕊𝕩: h←⌊(2+𝕩)÷5 ⋄ (𝕊 h) ∾ (2+𝕩-h×5)⊏"=-012";
+ 𝕊⁼𝕩: +´(¯2+"=-012"⊐𝕩)×({5⋆𝕩}¨⌽↕≠𝕩)
+}
+•Show Snafu+´Snafu⁼¨•file.Lines ⊑•args