aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2021-01-16 23:54:37 +0000
committerGitHub <noreply@github.com>2021-01-16 23:54:37 +0000
commit2bc9c1f57a4ee3c0d99158c9f8df1e10336d5d63 (patch)
treefbe40d5a4c99d5b6a4da88217d941720230e9fc6
parenta6e748740b94961a42892df4d1f6660bffa2e1ff (diff)
parent07ba3f1134ae48d7a8807b837159c7f8b959bcb5 (diff)
downloadperlweeklychallenge-club-2bc9c1f57a4ee3c0d99158c9f8df1e10336d5d63.tar.gz
perlweeklychallenge-club-2bc9c1f57a4ee3c0d99158c9f8df1e10336d5d63.tar.bz2
perlweeklychallenge-club-2bc9c1f57a4ee3c0d99158c9f8df1e10336d5d63.zip
Merge pull request #3282 from wambash/challenge-week-095
solutions week 095
-rw-r--r--challenge-095/wambash/raku/ch-1.raku17
-rw-r--r--challenge-095/wambash/raku/ch-2.raku19
2 files changed, 36 insertions, 0 deletions
diff --git a/challenge-095/wambash/raku/ch-1.raku b/challenge-095/wambash/raku/ch-1.raku
new file mode 100644
index 0000000000..cdec64fc2b
--- /dev/null
+++ b/challenge-095/wambash/raku/ch-1.raku
@@ -0,0 +1,17 @@
+#!/usr/bin/env raku
+
+sub palindrom-number ( $n ) {
+ $n eq $n.flip
+}
+
+multi MAIN (Bool :$test!) {
+ use Test;
+ is palindrom-number(1221), True;
+ is palindrom-number(-101), False;
+ is palindrom-number( 90), False;
+ done-testing;
+}
+
+multi MAIN ($n) {
+ say +palindrom-number $n
+}
diff --git a/challenge-095/wambash/raku/ch-2.raku b/challenge-095/wambash/raku/ch-2.raku
new file mode 100644
index 0000000000..66959511bb
--- /dev/null
+++ b/challenge-095/wambash/raku/ch-2.raku
@@ -0,0 +1,19 @@
+#!/usr/bin/env raku
+
+class Stack {
+ has @!stack handles (|<push pop min>, top => <tail>);
+}
+
+multi MAIN (Bool :$test! ) {
+ use Test;
+ with Stack.new {
+ .push: 2;
+ .push: -1;
+ .push: 0;
+ .pop;
+ is .top, -1;
+ .push: 0;
+ is .min, -1;
+ }
+ done-testing;
+}