aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-326/simon-proctor/README2
-rw-r--r--challenge-326/simon-proctor/raku/ch-1.raku8
-rw-r--r--challenge-326/simon-proctor/raku/ch-2.raku13
3 files changed, 23 insertions, 0 deletions
diff --git a/challenge-326/simon-proctor/README b/challenge-326/simon-proctor/README
index f674742166..6573911693 100644
--- a/challenge-326/simon-proctor/README
+++ b/challenge-326/simon-proctor/README
@@ -1 +1,3 @@
Solution by Simon Proctor
+
+Blog at : https://khanate.co.uk/weekly/326.html \ No newline at end of file
diff --git a/challenge-326/simon-proctor/raku/ch-1.raku b/challenge-326/simon-proctor/raku/ch-1.raku
new file mode 100644
index 0000000000..decd57e7f7
--- /dev/null
+++ b/challenge-326/simon-proctor/raku/ch-1.raku
@@ -0,0 +1,8 @@
+#!/usr/bin/env raku
+
+#| Display the day of the year for a given date
+sub MAIN(
+ Date(Str) $d #= Date string in yyyy-mm-dd format
+) {
+ $d.day-of-year.say;
+}
diff --git a/challenge-326/simon-proctor/raku/ch-2.raku b/challenge-326/simon-proctor/raku/ch-2.raku
new file mode 100644
index 0000000000..98d208ebdf
--- /dev/null
+++ b/challenge-326/simon-proctor/raku/ch-2.raku
@@ -0,0 +1,13 @@
+#!/usr/bin/env raku
+
+#|( Given a even length list of integers print a list where you
+ pick each adjacent pair (i, j) and replace it with j, i times.)
+sub MAIN (
+ *@a where (
+ (@a.all ~~ Int)
+ && (@a.elems %% 2)
+ && (@a.rotor(1 => 1).map(*.Slip).all ~~ UInt)
+ ) #= Even length list of Integers
+) {
+ @a.rotor(2).map( -> ($x, $y) { |($y xx $x) }).say
+}