aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-185/luca-ferrari/raku/ch-2.p619
1 files changed, 19 insertions, 0 deletions
diff --git a/challenge-185/luca-ferrari/raku/ch-2.p6 b/challenge-185/luca-ferrari/raku/ch-2.p6
new file mode 100755
index 0000000000..a04eb12cc4
--- /dev/null
+++ b/challenge-185/luca-ferrari/raku/ch-2.p6
@@ -0,0 +1,19 @@
+#!raku
+
+# Perl Weekly Challenge 185
+
+sub MAIN( *@codes ) {
+ my @output-codes;
+ for @codes -> $current-code {
+ my @current-output;
+ my $counter = 4;
+ for $current-code.comb -> $current-char is copy {
+ $current-char = 'x' and $counter-- if $current-char ~~ / <[0..9a..z]> / && $counter > 0;
+ @current-output.push: $current-char;
+ }
+
+ @output-codes.push: @current-output.join;
+ }
+
+ @output-codes.join( "\n" ).say;
+}