aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus "Holli" Holzer <holli.holzer@gmail.com>2020-10-06 02:31:48 +0200
committerMarkus "Holli" Holzer <holli.holzer@gmail.com>2020-10-06 02:31:48 +0200
commitdaab3535d86432ed54c56abc3865c26fe07d7aed (patch)
treef160e663ce496c24c5626995de2a6bdfed2afcc8
parent442b860e270048cd15837325de48270180a9323b (diff)
downloadperlweeklychallenge-club-daab3535d86432ed54c56abc3865c26fe07d7aed.tar.gz
perlweeklychallenge-club-daab3535d86432ed54c56abc3865c26fe07d7aed.tar.bz2
perlweeklychallenge-club-daab3535d86432ed54c56abc3865c26fe07d7aed.zip
%% for Str
-rw-r--r--challenge-081/markus-holzer/raku/ch-1.raku10
1 files changed, 5 insertions, 5 deletions
diff --git a/challenge-081/markus-holzer/raku/ch-1.raku b/challenge-081/markus-holzer/raku/ch-1.raku
index 8d61f71011..5f67b1f491 100644
--- a/challenge-081/markus-holzer/raku/ch-1.raku
+++ b/challenge-081/markus-holzer/raku/ch-1.raku
@@ -1,7 +1,7 @@
-unit sub MAIN(Str $A, $B);
+unit sub MAIN( Str $A, $B where $B.chars > $A.chars );
-my $chars = ( $A, $B ).max.chars;
-my @chars = ( $A, $B ).min.comb;
+# Custom operator, just for fun
+multi sub infix:<%%>( Str $n, Str $d ) {
+ $n eq $d x $n.chars div $d.chars }
-.say for ( [\~] @chars ).grep( -> $part {
- $part x $chars div $part.chars eq $B }) \ No newline at end of file
+.say for grep $B %% *, [\~] $A.comb \ No newline at end of file