apl-competition-2021/phase1.dyalog
2023-10-23 10:57:02 +02:00

23 lines
No EOL
1.1 KiB
APL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:Namespace Phase1
⍝ 1: Are You a Bacteria?
bacteria{100×(+/÷)'GC'}
⍝ 2: Index-Of Modified
indexof{(0@((1+)=))}
⍝ 3: Multiplicity
multiply((0=.|,)(/¨)())
⍝ 4: Square Peg, Round Hole
squarepeg{(-2×)4÷*2}
⍝ 5: Rect-ify
rectify{[(,)2÷1+]}() ⍝ only for ⍵>0
rectify{⎕div1(,÷)(()(*0.5))}
⍝ 6: Fischer Random Chess
fischerchess{(/2|'B'=)/('K'=)<'R'=}
⍝ 7: Can You Feel the Magic?
magic{1=,+/((1 1)¨(,))}
⍝ 8: Time to Make a Difference
timetomake(|-(+/1 60 1440×3))
⍝ 9: In the Long Run
longrun{/,(/¨)¨2((</),(>/),(=/))}
⍝ 10: On the Right Side
right((-)¨)
:EndNamespace