deb←{                                           ⍝ Drop Ending Blanks.
    ⍺←' ' ⋄ 1<|≡⍵:(⊂⍺)∇¨⍵                       ⍝ nested?
    2<⍴⍴⍵:(¯1↓⍴⍵){(⍺,1↓⍴⍵)⍴⍵}⍺ ∇,[¯1↓⍳⍴⍴⍵]⍵     ⍝ array
    b←⍵∊⍺                                       ⍝ mask
    1≥⍴⍴⍵:((∧\b)⍱⌽∧\⌽b)/⍵                       ⍝ vector
    b←∧⌿b((∧\b)⍱⌽∧\⌽b)/⍵                     ⍝ matrix
}

code_colours

test script

Back to: notes

Back to: Workspaces