Created
August 1, 2020 15:19
-
-
Save HumanEquivalentUnit/175fe4c843581e3a034f1b4e3dbc2489 to your computer and use it in GitHub Desktop.
Dyalog APL Competition 2020 - Phase I solutions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((0>⊣)⌽((⊂↑),(⊂↓))) ⍝ 1. Let's Split | |
(⊢⊂⍨(128∘>∨191∘<)) ⍝ 2. Characters | |
{26⊥⎕A⍳⍵} ⍝ 3. Columns | |
{(0=400|⍵)∨(≠⌿0=4 100∘.|⍵)} ⍝ 4. Take a Leap | |
{⎕IO←0 ⋄ ⌽⍣(>/⍵)⊢(⌊/⍵)+⍳1+(⌈/-⌊/)⍵} ⍝ 5. Stepping | |
{⍵[⍒⍺=⍵]} ⍝ 6. Move To Front | |
{⍺=2⊥bits∧⍺⊤⍨2⍴⍨≢bits←2⊥⍣¯1⊢⍵} ⍝ 7. Bits | |
{(∨/(1 ¯1⍴⍨≢)⍷⍨(×2-/⊢))10⊥⍣¯1⊢⍵} ⍝ 8. Zigzag | |
{peak←(⊢⍳⌈/),⍵ ⋄ notDesc←(⍳∘≢≡⍋) ⋄ (notDesc peak↑⍵) ∧ (notDesc ⌽peak↓⍵)} ⍝ 9. Rise and fall | |
⍝ 10. Stacking It Up - not done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment