Hacker News new | ask | show | jobs
by rak1507 1859 days ago
⍵≡'*' should be ⍵≡,'*' like in the original k

us←⊃,⍥⊆2{(⍺≡⊃K)∧⍵≡,'*':,'_'⋄⍵}/⊢ is shorter anyway

1 comments

    us←{'_'@{¯1⌽⍵⍷⍨(⊂⊃K),'*'}⍵}
Ah, ⍷, clever, don't even need the outer {...⍵},

  us←'_'@{¯1⌽⍵⍷⍨(⊂⊃K),'*'}
Yes!

You could also do: ⌽'*',⊂⊃K to save another character. I don't know if that's "better" though.

Or alternatively '*',⍨⊂⊃K which I think I prefer over ⌽, but neither seem that 'better' in my mind anyway.