Refactor as a namespace

This commit is contained in:
Dimitri Lozeve 2020-05-09 12:28:02 +02:00
parent bf5298b2d5
commit 2ec19672f5

View file

@ -1,18 +1,20 @@
⍝ 1: Let's Split! :Namespace Phase1
split←(0>⊣)⌽((⊂↑),(⊂↓)) ⍝ 1: Let's Split!
⍝ 2: Character Building split←(0>⊣)⌽((⊂↑),(⊂↓))
characters←{(~⍵∊127+64)⊂⍵} ⍝ 2: Character Building
⍝ 3: Excel-lent Columns characters←{(~⍵∊127+64)⊂⍵}
columns←26⊥64-⍨⎕UCS ⍝ 3: Excel-lent Columns
⍝ 4: Take a Leap columns←26⊥64-⍨⎕UCS
leap←1 3∊⍨(0+.=400 100 4∘.|⊢) ⍝ 4: Take a Leap
⍝ 5: Stepping in the Proper Direction leap←1 3∊⍨(0+.=400 100 4∘.|⊢)
stepping←{(⊃⍵)+(-×-/⍵)×0,|-/⍵} ⍝ 5: Stepping in the Proper Direction
⍝ 6: Please Move to the Front stepping←{(⊃⍵)+(-×-/⍵)×0,|-/⍵}
movefront←{⍵[⍋⍺≠⍵]} ⍝ 6: Please Move to the Front
⍝ 7: See You in a Bit movefront←{⍵[⍋⍺≠⍵]}
bits←{f←⍸∘⌽(2∘⊥⍣¯1)⋄∧/(f)∊f⍵} ⍝ 7: See You in a Bit
⍝ 8: Zigzag Numbers bits←{f←⍸∘⌽(2∘⊥⍣¯1)⋄∧/(f)∊f⍵}
zigzag←∧/2=∘|2-/∘×2-/(10∘⊥⍣¯1) ⍝ 8: Zigzag Numbers
⍝ 9: Rise and Fall zigzag←∧/2=∘|2-/∘×2-/(10∘⊥⍣¯1)
risefall←{∧/(⍳∘≢≡⍋)¨(⊂((⊢⍳⌈/)↑⊢),⍵),⊂⌽((⊢⍳⌈/)↓⊢),⍵} ⍝ 9: Rise and Fall
risefall←{∧/(⍳∘≢≡⍋)¨(⊂((⊢⍳⌈/)↑⊢),⍵),⊂⌽((⊢⍳⌈/)↓⊢),⍵}
:EndNamespace