chiark / gitweb /
Tidy up and comment map prep in 05a
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 5 May 2024 11:32:25 +0000 (12:32 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 5 May 2024 11:32:32 +0000 (12:32 +0100)
05/05a.bqn

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