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:
3d518b0
)
05a done
author
Ben Harris
<bjh21@bjh21.me.uk>
Sun, 5 May 2024 11:55:56 +0000
(12:55 +0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Sun, 5 May 2024 11:55:56 +0000
(12:55 +0100)
05/05a.bqn
patch
|
blob
|
history
diff --git
a/05/05a.bqn
b/05/05a.bqn
index 7990c6b26397ffee7ab0f7e07ac5788ca7bd6298..9dcc06589ae15ffac4a7d56fb084dfe038417de8 100644
(file)
--- a/
05/05a.bqn
+++ b/
05/05a.bqn
@@
-20,4
+20,15
@@
Prep←{
⟨map, proc⟩
}
-•Show Prep •file.Lines ⊑•args
+ExecuteMove←{⟨from,to⟩𝕊stacks:
+ crate←⊑from⊑stacks
+ stacks↩(1⊸↓)⌾(from⊸⊑) stacks
+ stacks↩(⟨crate⟩⊸∾)⌾(to⊸⊑) stacks
+ stacks
+}
+
+Main←{𝕊⟨map,proc⟩:
+ ⊑¨1↓ map ExecuteMove˝⌽proc
+}
+
+•Show Main Prep •file.Lines ⊑•args