Skip to content

Instantly share code, notes, and snippets.

@kspalaiologos
Created August 3, 2023 10:14
Show Gist options
  • Save kspalaiologos/e716bfafb311e0992250a08cff0c313c to your computer and use it in GitHub Desktop.
Save kspalaiologos/e716bfafb311e0992250a08cff0c313c to your computer and use it in GitHub Desktop.
Phase 1 of the Dyalog APL competition.
e1←{⍵/⍨⍵≥⌈\⍵}
e2←⌽⍷⍥⌽
e3←{(⍺∘⌽⌷⍨∘⊂⍵⍳⍨⊢)' ',⎕A}
e4←×2⊥>-<
e5←{n,l-n←(l↑⍺)+.≤⍵↑⍨l←⍺⌊⍥≢⍵}
e6←(⊢⍴⍨2,⍨2÷⍨⍴)~⍤∊⍨⊆⊢
e7←(,÷∨)∘1
e8←{3↑⊃¯2⎕dt(1⎕dt⊂⍵)+⌊/644 924 759|⍺-⍥(1⎕dt⊆)⍵}
e9←{↑,/⌽¨⍵⊂⍨1 0⍴⍨≢⍵}
e0←{(⊢,(⊂'')↑⍨⍺-≢)1↓¨(' ',⍵)⊂⍨(⊢∧⍺≥+\)1,' '=⍵}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment