diff options
| -rw-r--r-- | impl.bqn | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -66,6 +66,17 @@ match←{(0⊑𝕨)◶(1⊑𝕨)‿𝕩}´⟨ {1×´⥊𝕨Match¨𝕩} ⟩ +Indices←{ + ! 1==𝕩 + l←≠𝕩 + { + ! 1×´Nat¨𝕩 + es ← +`𝕩 ⋄ e←0 ⋄ Ei←{e↩𝕩⊑es} + Ei i←0 + {j←𝕩⋄U←{U⍟(j=Ei)1+𝕩}⋄{i↩U𝕩}⍟(𝕩=e)i}¨↕(l-1)⊑es + }⍟(0<l)𝕩 +} + + ↩ + _perv - ↩ - _perv × ↩ (0⊸(<->) ⊘ ×) _perv @@ -232,11 +243,6 @@ Windows←{ Reverse ← {!1≤=𝕩 ⋄ (-↕⊸¬≠𝕩)⊏𝕩} Rotate ← {!Int𝕨 ⋄ l←≠𝕩⋄(l|𝕨+↕l)⊏𝕩} _onAxes_ 0 -Indices←{ - ! 1==𝕩 - ! ∧´Nat¨𝕩 - ⟨⟩∾´𝕩⥊¨↕≠𝕩 -} Rep ← Indices⊸⊏ Replicate ← {0<=𝕨}◶(⥊˜⟜≠Rep⊢)‿{!𝕨=○≠𝕩⋄𝕨Rep𝕩} _onAxes_ (1-0=≠) |
