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:
20ab8a1
)
05a: slightly simpler Prep1Proc
author
Ben Harris
<bjh21@bjh21.me.uk>
Sun, 5 May 2024 12:09:48 +0000
(13:09 +0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Sun, 5 May 2024 12:09:48 +0000
(13:09 +0100)
05/05a.bqn
patch
|
blob
|
history
diff --git
a/05/05a.bqn
b/05/05a.bqn
index 1efb640e97942925447bc8d633239b6add731f09..e74a64f213b858a5bb54bbf2c9a9a16156ad3115 100644
(file)
--- a/
05/05a.bqn
+++ b/
05/05a.bqn
@@
-8,7
+8,7
@@
Split←{
Prep1Proc←{ # Prepare one step of procedure
# Converts "move 3 from 1 to 3" into [⟨1,3⟩,⟨1,3⟩,⟨1,3⟩].
⟨n,f,t⟩←•ParseFloat¨⟨1,3,5⟩⊏(' '=𝕩)Split𝕩
-
⟨n⟩
/[⟨f,t⟩]
+
n
/[⟨f,t⟩]
}
Prep←{
@@
-22,8
+22,8
@@
Prep←{
ExecuteMove←{⟨from,to⟩𝕊stacks:
crate←⊑from⊑stacks
- stacks (1⊸↓)⌾(from⊸⊑) ↩
- stacks (⟨crate⟩⊸∾)⌾(to⊸⊑) ↩
+ stacks
(1⊸↓)⌾(from⊸⊑) ↩
+ stacks (⟨crate⟩⊸∾)⌾(to⊸⊑)
↩
stacks
}