aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-339/wambash/raku/ch-2.raku20
1 files changed, 20 insertions, 0 deletions
diff --git a/challenge-339/wambash/raku/ch-2.raku b/challenge-339/wambash/raku/ch-2.raku
new file mode 100644
index 0000000000..bf22a0689a
--- /dev/null
+++ b/challenge-339/wambash/raku/ch-2.raku
@@ -0,0 +1,20 @@
+#!/usr/bin/env raku
+
+sub peak-point (+gain) {
+ max [\+] 0, |gain
+
+}
+
+multi MAIN (Bool :test($)!) {
+ use Test;
+ is peak-point(-5, 1, 5, -9, 2), 1;
+ is peak-point(10,10,10,-25), 30;
+ is peak-point(3, -4, 2, 5, -6, 1), 6;
+ is peak-point(-1, -2, -3, -4), 0;
+ is peak-point(-10, 15, 5), 10;
+ done-testing;
+}
+
+multi MAIN (+gain) {
+ say peak-point gain;
+}