diff options
| author | RikedyP <rikedyp@gmail.com> | 2025-09-09 09:56:27 +0100 |
|---|---|---|
| committer | RikedyP <rikedyp@gmail.com> | 2025-09-09 09:56:27 +0100 |
| commit | a180c2af9230a1dd1c81637b33cabf01d760b3ae (patch) | |
| tree | 5dcd37e36cb71f269dbd6db665a186a0f6ee8d92 | |
| parent | c20cc8228c699aba616f0d1d039ef0a15d12b893 (diff) | |
| download | perlweeklychallenge-club-a180c2af9230a1dd1c81637b33cabf01d760b3ae.tar.gz perlweeklychallenge-club-a180c2af9230a1dd1c81637b33cabf01d760b3ae.tar.bz2 perlweeklychallenge-club-a180c2af9230a1dd1c81637b33cabf01d760b3ae.zip | |
week 338 in APL
| -rw-r--r-- | challenge-338/richard-park/apl/HighestRow.aplf | 21 | ||||
| -rw-r--r-- | challenge-338/richard-park/apl/MaxDistance.aplf | 13 |
2 files changed, 34 insertions, 0 deletions
diff --git a/challenge-338/richard-park/apl/HighestRow.aplf b/challenge-338/richard-park/apl/HighestRow.aplf new file mode 100644 index 0000000000..61bc27d5da --- /dev/null +++ b/challenge-338/richard-park/apl/HighestRow.aplf @@ -0,0 +1,21 @@ + HighestRow←{ + HR←{ + ⌈/+/⍵ + } + +⍝ Tests + Assert←{⍺←'Assertion Failure' ⋄ 0∊⍵:⍺ ⎕SIGNAL 8 ⋄ shy←0} + Assert 16 ≡ HR[ 4 4 4 4 + 10 0 0 0 + 2 2 2 9]: + Assert 10 ≡ HR[1 5 + 7 3 + 3 5]: + Assert 6 ≡ HR[1 2 3 + 3 2 1]: + Assert 17 ≡ HR[2 8 7 + 7 1 3 + 1 9 5]: + 'All tests passed.' + + } diff --git a/challenge-338/richard-park/apl/MaxDistance.aplf b/challenge-338/richard-park/apl/MaxDistance.aplf new file mode 100644 index 0000000000..322db02b53 --- /dev/null +++ b/challenge-338/richard-park/apl/MaxDistance.aplf @@ -0,0 +1,13 @@ + MaxDistance←{ + MD←{ + ⌈/,|⍵∘.-⍺ + } +⍝ Tests + Assert←{⍺←'Assertion Failure' ⋄ 0∊⍵:⍺ ⎕SIGNAL 8 ⋄ shy←0} + Assert 6≡4 5 7 MD 9 1 3 4: + Assert 6≡2 3 5 4 MD 3 2 5 5 8 7: + Assert 9≡2 1 11 3 MD 2 5 10 2: + Assert 2≡1 2 3 MD 3 2 1: + Assert 5≡1 0 2 3 MD 5 0: + 'All tests passed.' + } |
