diff options
Diffstat (limited to 'src')
| -rwxr-xr-x | src/pr.bqn | 2 | ||||
| -rw-r--r-- | src/r0.bqn | 2 | ||||
| -rw-r--r-- | src/r1.bqn | 8 |
3 files changed, 6 insertions, 6 deletions
@@ -13,7 +13,7 @@ keep ← "!+-×÷⋆⌊=≤≢⥊⊑↕⌜`⊘⎊" chrext ← glyphs ∾¨ ((+´·∧`'_'=0‿¯1⊸⊏)¨def) ⊔ alias Typ ← chrext⊸((+`≠¨)∘⊣⍋∾⊸⊐) -in0‿out0 ← ⟨"∩⍝+-×⌊=≤≢⥊⊑↕⌜⊘", "⌊⌈|<>≠≥⊢⊣∾↑↓⊏˙˜´∘○⊸⟜◶⍟"⟩ +in0‿out0 ← ⟨"∩⍝+-×⌊=≤≢⥊⊑↕⌜⊘", "⌊⌈|<>≠≥⊢⊣∾↑↓⊏˙˜¨´∘○⊸⟜◶⍟"⟩ in2 ← alias∾keep out2 ← ∾glyphs in‿out ← rtt ⊑ ⟨in0,out0⟩‿⟨⍷in2∾out0,out2⟩‿⟨in2,out2⟩ @@ -30,6 +30,8 @@ Box ← {𝕩Fill⟨⟩⥊⟨𝕩⟩} ↑ ← {⊑⟜𝕩⌜↕𝕨} # LIMITED to number 𝕨 and list 𝕩 ↓ ← {(𝕨⊸+⊑𝕩˙)⌜↕(≠𝕩)-𝕨} # LIMITED to number 𝕨 and list 𝕩 +¨ ← { d←⥊𝕩⋄(≢𝕩)⥊(⊑⟜(⥊𝕨)𝔽⊑⟜d)⌜↕≠d } # LIMITED to equal-shape arrays + _fold0←{ l←≠𝕩 ⋄ F←𝔽 r←𝕨 {l↩l-1⋄l⊑𝕩}⊘⊣ 𝕩 @@ -15,6 +15,7 @@ Deshape ← IsArray◶{𝕩Fill⟨𝕩⟩}‿⥊ Pair ← {⟨𝕩⟩} ⊘ {⟨𝕨,𝕩⟩} ToArray ← <⍟(1-IsArray) Cell ← ↓⟜≢ +MatchS ← 1×´=¨ _qSearch ← {+´·×`𝕗(1-=)⌜<} _glyphLookup_ ← { @@ -42,9 +43,6 @@ _fold←{ 𝕨 (0<≠)⊘1◶⟨Identity 𝕗˙, 𝔽´⟩ 𝕩 } -¨ ← { d←⥊𝕩⋄(≢𝕩)⥊(⊑⟜(⥊𝕨)𝔽⊑⟜d)⌜↕≠d } # LIMITED to equal-shape array arguments -MatchS ← 1×´=¨ - _eachd←{ _d←{ # Equal ranks p←≢𝕨 @@ -431,7 +429,7 @@ _takeDrop←{ _c ← { (×⟜𝕗⌜𝕨) +⌜ 𝕩 } i←<0 ⋄ k←1 ⋄ UIk←{ i (k×𝕨)_c↩ k ↕⊸(𝕨_c)⍟(1-=⟜1) 𝕩 ⋄ k↩1 ⋄ ≠𝕩 } doFil←0 - sh ← s Noop◶{k×↩𝕨⋄𝕨}‿(⊣ UIk {𝕩⋄doFil↩1}_inds)¨ 𝕨 + sh ← (r↑s) Noop◶{k×↩𝕨⋄𝕨}‿(⊣ UIk {𝕩⋄doFil↩1}_inds)¨ 𝕨 (0<=i)◶(s⊸⥊)‿{ sh ∾↩ t ← r↓s {i 𝕩_c↩ ↕𝕩}⍟(1-1⊸=) k×´t @@ -482,7 +480,7 @@ Windows←{ "𝕨↕𝕩: Length of 𝕨 must be at most rank of 𝕩" ! r≤=𝕩 "𝕨↕𝕩: 𝕨 must consist of natural numbers" ! ×´Nat⌜𝕨 s←≢𝕩 - l←s(1+-)¨𝕨 + l←(r↑s)(1+-)¨𝕨 "𝕨↕𝕩: Window length 𝕨 must be at most axis length plus one" ! ×´0⊸≤⌜l k←1×´t←r↓s str ← Reverse ×`⟨k⟩∾s⊏˜{𝕩⊸-⌜↕𝕩}r-1 |
