From 47f51d455df907e5c881dc0cb077db9f9edd961a Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sun, 5 May 2024 12:55:56 +0100 Subject: [PATCH] 05a done --- 05/05a.bqn | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/05/05a.bqn b/05/05a.bqn index 7990c6b..9dcc065 100644 --- 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 -- 2.30.2