aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark <53903062+andemark@users.noreply.github.com>2022-09-05 07:09:03 +0000
committerMark <53903062+andemark@users.noreply.github.com>2022-09-05 07:09:03 +0000
commit963fa84611ed60f110952df1213c60a19dfe1510 (patch)
tree08c8a7a5c90bd96129d773d0fdb00eca0e085b87
parent9e7dff6ae83a35704f87668beec81b1ef41ee2b9 (diff)
downloadperlweeklychallenge-club-963fa84611ed60f110952df1213c60a19dfe1510.tar.gz
perlweeklychallenge-club-963fa84611ed60f110952df1213c60a19dfe1510.tar.bz2
perlweeklychallenge-club-963fa84611ed60f110952df1213c60a19dfe1510.zip
Challenge 181 Solutions (Raku)
-rw-r--r--challenge-181/mark-anderson/raku/ch-1.raku8
-rw-r--r--challenge-181/mark-anderson/raku/ch-2.raku8
-rw-r--r--challenge-181/mark-anderson/raku/paragraph.txt5
-rw-r--r--challenge-181/mark-anderson/raku/temps.txt10
4 files changed, 31 insertions, 0 deletions
diff --git a/challenge-181/mark-anderson/raku/ch-1.raku b/challenge-181/mark-anderson/raku/ch-1.raku
new file mode 100644
index 0000000000..00d463e75b
--- /dev/null
+++ b/challenge-181/mark-anderson/raku/ch-1.raku
@@ -0,0 +1,8 @@
+#!/usr/bin/env raku
+use Text::Wrap;
+
+say wrap-text('paragraph.txt'.IO.slurp
+ .trans(/\n/ => ' ')
+ .split('.')
+ .map({ .words.sort(*.lc) })
+ .join('. '), :width(60));
diff --git a/challenge-181/mark-anderson/raku/ch-2.raku b/challenge-181/mark-anderson/raku/ch-2.raku
new file mode 100644
index 0000000000..2171e768a3
--- /dev/null
+++ b/challenge-181/mark-anderson/raku/ch-2.raku
@@ -0,0 +1,8 @@
+#!/usr/bin/env raku
+
+say 'temps.txt'.IO.lines
+ .sort
+ .rotor(2 => -1)
+ .grep({ .[0].match(/\d+$/) < .[1].match(/\d+$/) })
+ .map( { .[1].match(/<[\d-]>+/) })
+ .join("\n");
diff --git a/challenge-181/mark-anderson/raku/paragraph.txt b/challenge-181/mark-anderson/raku/paragraph.txt
new file mode 100644
index 0000000000..af2d76e73b
--- /dev/null
+++ b/challenge-181/mark-anderson/raku/paragraph.txt
@@ -0,0 +1,5 @@
+All he could think about was how it would all end. There was
+still a bit of uncertainty in the equation, but the basics
+were there for anyone to see. No matter how much he tried to
+see the positive, it wasn't anywhere to be seen. The end was
+coming and it wasn't going to be pretty.
diff --git a/challenge-181/mark-anderson/raku/temps.txt b/challenge-181/mark-anderson/raku/temps.txt
new file mode 100644
index 0000000000..7b251c9aec
--- /dev/null
+++ b/challenge-181/mark-anderson/raku/temps.txt
@@ -0,0 +1,10 @@
+2022-08-01, 20
+2022-08-09, 10
+2022-08-03, 19
+2022-08-06, 24
+2022-08-05, 22
+2022-08-10, 28
+2022-08-07, 20
+2022-08-04, 18
+2022-08-08, 21
+2022-08-02, 25