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:
dee9e08
)
09a done
author
Ben Harris
<bjh21@bjh21.me.uk>
Thu, 9 May 2024 08:40:52 +0000
(09:40 +0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Thu, 9 May 2024 08:40:52 +0000
(09:40 +0100)
09/09a.bqn
patch
|
blob
|
history
diff --git
a/09/09a.bqn
b/09/09a.bqn
index 2a8d1158a820c8b48747460a0ef0de9aff91bf6b..4cb47cce3034644137c2dfb2e093e0ac9746b4eb 100644
(file)
--- a/
09/09a.bqn
+++ b/
09/09a.bqn
@@
-1,8
+1,8
@@
Prep←{
directions←⍉['U'‿⟨0,1⟩,'D'‿⟨0,¯1⟩,'L'‿⟨¯1,0⟩,'R'‿⟨1,0⟩]
- dirsâ
\86
\90
((â
\8a
\8f
directions)â
\8a
\90
â
\8a
\8f
â
\8d
\89
𝕩)⊏(1⊏directions)
- dists←•ParseFloat
˘2↓˘
𝕩
+ dirsâ
\86
\90
((â
\8a
\8f
directions)â
\8a
\90
â
\8a
\91
¨
𝕩)⊏(1⊏directions)
+ dists←•ParseFloat
¨2↓¨
𝕩
dists/dirs
}
@@
-10,4
+10,4
@@
Step←{⟨h,t⟩𝕊m:h+↩m,t+↩(×h-t)×(∨´1<|h-t),⟨h,t⟩}
Main←{+´∊1⊑¨ (<⟨⟨0,0⟩,⟨0,0⟩⟩)Step`𝕩}
-•Show Main Prep
>
•file.Lines ⊑•args
+•Show Main Prep
•file.Lines ⊑•args