From: Ben Harris Date: Sun, 5 May 2024 11:32:25 +0000 (+0100) Subject: Tidy up and comment map prep in 05a X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=3d518b0b0568c2013dd5eb35ab87a7431433d5a9;p=aoc-2022.git Tidy up and comment map prep in 05a --- diff --git a/05/05a.bqn b/05/05a.bqn index f144cf1..7990c6b 100644 --- a/05/05a.bqn +++ b/05/05a.bqn @@ -13,10 +13,11 @@ Prep1Proc←{ # Prepare one step of procedure Prep←{ ⟨rawmap, rawproc⟩←(""⊸≡¨𝕩)Split𝕩 - map0←{(𝕩≠' ')/𝕩}¨<˘⍉⌽>¯1↓rawmap - map1←⟨""⟩∾(1=4|↕≠map0)/map0 + map0←⍉>¯1↓rawmap # Drop last line and transpose + map1←(1=4|↕≠map0)/map0 # Extract crate letters from chaff + map←⟨""⟩∾{(𝕩≠' ')/𝕩}¨<˘map1 # Convert to a 0-based list of strings proc←∾Prep1Proc¨rawproc - ⟨map1, proc⟩ + ⟨map, proc⟩ } •Show Prep •file.Lines ⊑•args