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:
0d7155c
)
09a: restructure to calculate head and tail paths separately
author
Ben Harris
<bjh21@bjh21.me.uk>
Thu, 9 May 2024 12:43:49 +0000
(13:43 +0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Thu, 9 May 2024 12:43:49 +0000
(13:43 +0100)
09/09a.bqn
patch
|
blob
|
history
diff --git
a/09/09a.bqn
b/09/09a.bqn
index 9d0161ab4202032e8c67fc83a882834d7503b34e..4f9d0271d4436139060e5fc6d588844bacbfd2b3 100644
(file)
--- a/
09/09a.bqn
+++ b/
09/09a.bqn
@@
-8,8
+8,10
@@
Prep←{
StepH←{h𝕊m:h+m}
StepT←{t𝕊h:t+(×h-t)×(∨´1<|h-t)}
-Step←{⟨h,t⟩𝕊m:h StepH↩m,t StepT↩h,⟨h,t⟩}
-Main←{+´∊1⊑¨ (<⟨⟨0,0⟩,⟨0,0⟩⟩)Step`𝕩}
+Main←{
+ start←<⟨0,0⟩
+ +´∊ start StepT` start StepH` 𝕩
+}
•Show Main Prep •file.Lines ⊑•args