aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-117/luca-ferrari/blog-1.txt1
-rw-r--r--challenge-117/luca-ferrari/blog-2.txt1
-rw-r--r--challenge-117/luca-ferrari/raku/ch-1.p611
-rw-r--r--challenge-117/luca-ferrari/raku/ch-2.p615
-rw-r--r--challenge-117/luca-ferrari/raku/test.txt14
5 files changed, 42 insertions, 0 deletions
diff --git a/challenge-117/luca-ferrari/blog-1.txt b/challenge-117/luca-ferrari/blog-1.txt
new file mode 100644
index 0000000000..dc808c92d7
--- /dev/null
+++ b/challenge-117/luca-ferrari/blog-1.txt
@@ -0,0 +1 @@
+https://fluca1978.github.io/2021/06/15/PerlWeeklyChallenge117.html#task1
diff --git a/challenge-117/luca-ferrari/blog-2.txt b/challenge-117/luca-ferrari/blog-2.txt
new file mode 100644
index 0000000000..34935ceac0
--- /dev/null
+++ b/challenge-117/luca-ferrari/blog-2.txt
@@ -0,0 +1 @@
+https://fluca1978.github.io/2021/06/15/PerlWeeklyChallenge117.html#task2
diff --git a/challenge-117/luca-ferrari/raku/ch-1.p6 b/challenge-117/luca-ferrari/raku/ch-1.p6
new file mode 100644
index 0000000000..9f070c9a2a
--- /dev/null
+++ b/challenge-117/luca-ferrari/raku/ch-1.p6
@@ -0,0 +1,11 @@
+#!raku
+
+sub MAIN( Str $file-name = 'test.txt' ) {
+ my %lines = $file-name.IO.lines.map: { my ( $number, $content ) = .split( ',' );
+ $number.Int => $content.trim;
+ }
+
+ say "Missing line $_ !" if %lines{ $_ }:!exists
+ for 1 .. %lines.keys.sort( *.Int <=> *.Int )[ * - 1 ];
+
+}
diff --git a/challenge-117/luca-ferrari/raku/ch-2.p6 b/challenge-117/luca-ferrari/raku/ch-2.p6
new file mode 100644
index 0000000000..3a4070065f
--- /dev/null
+++ b/challenge-117/luca-ferrari/raku/ch-2.p6
@@ -0,0 +1,15 @@
+#!raku
+
+
+sub MAIN( Int $n ) {
+
+ my @directions.push:
+ 'R' x $n
+ , 'LH' x $n
+ , 'L' x $n ~ 'H' x $n
+ , 'LH' x ($n -1) ~ 'R' x ($n - 1 )
+ , 'R' x ($n - 1) ~ 'LH' x ($n - 1 )
+ , 'R' x ($n -1) ~ 'LH' x ($n - 1);
+
+ @directions.unique.say;
+}
diff --git a/challenge-117/luca-ferrari/raku/test.txt b/challenge-117/luca-ferrari/raku/test.txt
new file mode 100644
index 0000000000..5b9d9ab1ce
--- /dev/null
+++ b/challenge-117/luca-ferrari/raku/test.txt
@@ -0,0 +1,14 @@
+11, Line Eleven
+1, Line one
+9, Line Nine
+13, Line Thirteen
+2, Line two
+6, Line Six
+8, Line Eight
+10, Line Ten
+7, Line Seven
+4, Line Four
+14, Line Fourteen
+3, Line three
+15, Line Fifteen
+5, Line Five