chiark / gitweb /
05a done
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 5 May 2024 11:55:56 +0000 (12:55 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 5 May 2024 11:55:56 +0000 (12:55 +0100)
05/05a.bqn

index 7990c6b26397ffee7ab0f7e07ac5788ca7bd6298..9dcc06589ae15ffac4a7d56fb084dfe038417de8 100644 (file)
@@ -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