aboutsummaryrefslogtreecommitdiff
path: root/challenge-338/richard-park/apl/HighestRow.aplf
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-338/richard-park/apl/HighestRow.aplf')
-rw-r--r--challenge-338/richard-park/apl/HighestRow.aplf21
1 files changed, 21 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.'
+
+ }