diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-07-21 19:13:22 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-07-21 19:24:35 -0400 |
| commit | b3ecbb5695a5a0a0637c924da0022abca940ffee (patch) | |
| tree | bb6928abcb6d2019450ea48637ef1ceb856fe3c5 /md.bqn | |
| parent | bb7f6750d5be62bafff46dd94883189977b39d6a (diff) | |
Add Rank function as monadic =
Diffstat (limited to 'md.bqn')
| -rw-r--r-- | md.bqn | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -457,7 +457,7 @@ Fmt ← { p ↩ 0⌾(¯1⊸⊑) p Pad ← {i←/1+𝕨 ⋄ (¯1¨⌾((¬∊i)⊸/)i) ⊏ 𝕩∾(¯1⊑≢𝕩)⥊" "} p (⊑0∊ls)◶⟨Pad,+´⊸↑⟩ ((×´ls)∾¯1⊑≢𝕩) ⥊ 𝕩 - }⍟(2 < ≠∘≢) + }⍟(2 < =) # Horizontal padding: just some spaces on either side PadH ← { (𝕨/" ") (∾⎉1∾⎉1⊣) 𝕩 @@ -473,7 +473,7 @@ Fmt ← { (1∾-l)↑"┘" ⟩ } - FmtEmpty ← (0‿0≢≢)◶("┌┐"≍"└┘")‿(((2≠≠∘≢)∨0=≠)◶{ + FmtEmpty ← (0‿0≢≢)◶("┌┐"≍"└┘")‿(((2≠=)∨0=≠)◶{ '┐'⌾(0‿¯1⊸⊑) 2 Enframe 1 PadH " "¨𝕩 }‿{ ≍"⟨⟩"∾˜(1<≠)◶⟨"",'⥊'⌾(¯1⊸⊑)·∾·∾⟜"‿"¨⍕¨⟩≢𝕩 @@ -482,13 +482,13 @@ Fmt ← { s ← ≢¨ 𝕩 w ← ⌈´⥊<⎉1 1⊑¨s h ← ⌈´⎉1 ⊑¨s - ∾⎉2 ≍⍟(0⌈2-≠∘≢) (h ∾⌜ 𝕨×w¬(-𝕨×≠w)↑1) ↑¨ 𝕩 + ∾⎉2 ≍⍟(0⌈2-=) (h ∾⌜ 𝕨×w¬(-𝕨×≠w)↑1) ↑¨ 𝕩 } FmtMixed ← { - (≠≢𝕩) Enframe 2 Pad 𝕨 PaddingJoin F¨𝕩 + (=𝕩) Enframe 2 Pad 𝕨 PaddingJoin F¨𝕩 } F ← (2⌊≡)◶(≍≤⟜∞◶⟨"'"⊸(∾∾⊣),⍕⟩)‿{ - num ← 𝕩≤∞ ⋄ r ← ≠≢𝕩 + num ← 𝕩≤∞ ⋄ r ← =𝕩 ((≠(0⊸<+≤)+´)⥊num)◶{ # All characters k ← -≠ c ← ¯1↓≢𝕩 |
