aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2025-09-09 09:59:49 +0100
committerGitHub <noreply@github.com>2025-09-09 09:59:49 +0100
commitee0a6a958eeeb4e97c2f7accaeebfc6d315c2f15 (patch)
tree5dcd37e36cb71f269dbd6db665a186a0f6ee8d92
parentc20cc8228c699aba616f0d1d039ef0a15d12b893 (diff)
parenta180c2af9230a1dd1c81637b33cabf01d760b3ae (diff)
downloadperlweeklychallenge-club-ee0a6a958eeeb4e97c2f7accaeebfc6d315c2f15.tar.gz
perlweeklychallenge-club-ee0a6a958eeeb4e97c2f7accaeebfc6d315c2f15.tar.bz2
perlweeklychallenge-club-ee0a6a958eeeb4e97c2f7accaeebfc6d315c2f15.zip
Merge pull request #12653 from rikedyp/master
week 338 in APL
-rw-r--r--challenge-338/richard-park/apl/HighestRow.aplf21
-rw-r--r--challenge-338/richard-park/apl/MaxDistance.aplf13
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.'
+ }