aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-132/feng-chang/raku/ch-1.raku11
1 files changed, 11 insertions, 0 deletions
diff --git a/challenge-132/feng-chang/raku/ch-1.raku b/challenge-132/feng-chang/raku/ch-1.raku
new file mode 100755
index 0000000000..cfdc079760
--- /dev/null
+++ b/challenge-132/feng-chang/raku/ch-1.raku
@@ -0,0 +1,11 @@
+#!/bin/env raku
+
+my method dstr(Date:D $dt: --> Str:D) {
+ $dt.Str.trans('-' => '/')
+}
+
+sub MAIN(Str:D $birth-date-str) {
+ my Date \birth-date = $birth-date-str.trans('/' => '-').Date;
+ my UInt \age = now.Date - birth-date;
+ put "{ (birth-date - age).&dstr }, { (now.Date + age).&dstr }";
+}