diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-08-03 22:41:10 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-08-03 22:41:10 -0400 |
| commit | 89289fe19a4a0aa9866f299855d17a00df21332d (patch) | |
| tree | ce161d27b7d6573517455f4677d3f8f7ce2a1eaf | |
| parent | 046415773ace47b6b4e1a3747d115ef308548631 (diff) | |
Make the complicated parts of Take conditional
| -rw-r--r-- | impl.bqn | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -217,9 +217,9 @@ JoinTo←∨○(1≠=)◶∾‿{ Take←{ T←{ ! Int 𝕨 - l←≠𝕩 - i←(l+1)|¯1⌈l⌊((𝕨<0)×𝕨+l)+↕|𝕨 - i⊏JoinTo⟜(1⊸Cell⥊Type)⍟(∨´l=i)𝕩 + l←≠𝕩 ⋄ n←𝕨<0 ⋄ e←l⌊r←|𝕨 ⋄ s←⟨r⟩ + i ← 𝕩{s∾↩c←1 Cell 𝕨⋄𝕩(×+⌜↕∘⊢)×´c}⍟(1≠=𝕩) (l-e)+⍟n ↕e + s ⥊ 𝕩{(⥊𝕩)n◶⟨∾,∾˜⟩(r-e)⥊Type𝕗}⍟(l<r) ⊑⟜(⥊𝕩)¨i } 𝕨 T _onAxes_ 0 (⟨1⟩⥊˜0⌈𝕨-○≠⊢)⊸∾∘≢⊸⥊𝕩 } |
