From: Ben Harris Date: Sun, 5 May 2024 11:55:56 +0000 (+0100) Subject: 05a done X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=47f51d455df907e5c881dc0cb077db9f9edd961a;p=aoc-2022.git 05a done --- 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