aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-216/shimon-ben-avraham/raku/ch-1.md6
-rwxr-xr-xchallenge-216/shimon-ben-avraham/raku/ch-1.raku13
-rwxr-xr-xchallenge-216/shimon-ben-avraham/raku/registration-number.raku10
3 files changed, 16 insertions, 13 deletions
diff --git a/challenge-216/shimon-ben-avraham/raku/ch-1.md b/challenge-216/shimon-ben-avraham/raku/ch-1.md
index 5130597373..43bd6f28ae 100644
--- a/challenge-216/shimon-ben-avraham/raku/ch-1.md
+++ b/challenge-216/shimon-ben-avraham/raku/ch-1.md
@@ -1,6 +1,9 @@
+
TITLE
=====
+
+
Task 1: Registration Number
===========================
@@ -129,6 +132,5 @@ Finally, make sure we test every word in the `@words` array...
...and print the results!
```raku
- say @result.List;
+ say @result.map({"'$_'"}).join(', ').map({ ($_) } );
} # end of multi MAIN (Str $reg, *@words)
-
diff --git a/challenge-216/shimon-ben-avraham/raku/ch-1.raku b/challenge-216/shimon-ben-avraham/raku/ch-1.raku
index 400c22ce2e..31493cbe00 100755
--- a/challenge-216/shimon-ben-avraham/raku/ch-1.raku
+++ b/challenge-216/shimon-ben-avraham/raku/ch-1.raku
@@ -2,7 +2,7 @@
# Perl Weekly Challenge #216, Challenge 1
# © 2023 Shimon Bollinger. All rights reserved.
-# Last modified: Thu 11 May 2023 06:24:39 PM EDT
+# Last modified: Thu 11 May 2023 07:36:57 PM EDT
# Version 0.0.1
# always use the latest version of Raku
@@ -18,17 +18,18 @@ multi MAIN (Str $reg, *@words) {
@result.push($_) if
.lc
.comb($reg-letters)
- !~~ () for @words;
+ !~~ ()
+ for @words;
- say @result.List;
+ say @result.map({"'$_'"}).join(', ').map({ ($_) } );
} # end of multi MAIN (Str $reg, *@words)
#| Run with the option '--test' to test the program
multi MAIN (Bool :$test!) {
use Test::Output;
- output-is {samewith('AB1 2CD', <abc abcd abd>)}, "(abcd)\n", 'Example 1 OK';
- output-is {samewith('007 JB', <job james bjorg>)}, "(job bjorg)\n", 'Example 2 OK';
- output-is {samewith('C7 RA2', <crack road rac>)}, "(crack rac)\n", 'Example 3 OK';
+ output-is {samewith('AB1 2CD', <abc abcd abd>)}, "('abcd')\n", 'Example 1 OK';
+ output-is {samewith('007 JB', <job james bjorg>)}, "('job', 'bjorg')\n", 'Example 2 OK';
+ output-is {samewith('C7 RA2', <crack road rac>)}, "('crack', 'rac')\n", 'Example 3 OK';
}
diff --git a/challenge-216/shimon-ben-avraham/raku/registration-number.raku b/challenge-216/shimon-ben-avraham/raku/registration-number.raku
index f8e06ded41..230c49ea94 100755
--- a/challenge-216/shimon-ben-avraham/raku/registration-number.raku
+++ b/challenge-216/shimon-ben-avraham/raku/registration-number.raku
@@ -2,7 +2,7 @@
# Perl Weekly Challenge #216, Challenge 1
# © 2023 Shimon Bollinger. All rights reserved.
-# Last modified: Thu 11 May 2023 06:24:53 PM EDT
+# Last modified: Thu 11 May 2023 07:36:57 PM EDT
# Version 0.0.1
# always use the latest version of Raku
@@ -124,15 +124,15 @@ Finally, make sure we test every word in the C<@words> array...
...and print the results!
=end pod
- say @result.List;
+ say @result.map({"'$_'"}).join(', ').map({ ($_) } );
} # end of multi MAIN (Str $reg, *@words)
#| Run with the option '--test' to test the program
multi MAIN (Bool :$test!) {
use Test::Output;
- output-is {samewith('AB1 2CD', <abc abcd abd>)}, "(abcd)\n", 'Example 1 OK';
- output-is {samewith('007 JB', <job james bjorg>)}, "(job bjorg)\n", 'Example 2 OK';
- output-is {samewith('C7 RA2', <crack road rac>)}, "(crack rac)\n", 'Example 3 OK';
+ output-is {samewith('AB1 2CD', <abc abcd abd>)}, "('abcd')\n", 'Example 1 OK';
+ output-is {samewith('007 JB', <job james bjorg>)}, "('job', 'bjorg')\n", 'Example 2 OK';
+ output-is {samewith('C7 RA2', <crack road rac>)}, "('crack', 'rac')\n", 'Example 3 OK';
}