aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-095/mark-anderson/raku/ch-1.raku20
1 files changed, 20 insertions, 0 deletions
diff --git a/challenge-095/mark-anderson/raku/ch-1.raku b/challenge-095/mark-anderson/raku/ch-1.raku
new file mode 100644
index 0000000000..8f3d310dff
--- /dev/null
+++ b/challenge-095/mark-anderson/raku/ch-1.raku
@@ -0,0 +1,20 @@
+#!/usr/bin/env raku
+
+multi MAIN
+{
+ use Test;
+
+ ok palindrome(1221) == 1, "Example 1";
+ ok palindrome(-101) == 0, "Example 2";
+ ok palindrome(90) == 0, "Example 3";
+}
+
+multi MAIN(Str $N where $N ~~ Int)
+{
+ say palindrome($N);
+}
+
+sub palindrome(Int:D $N)
+{
+ .Int given $N eq $N.flip;
+}