From daab3535d86432ed54c56abc3865c26fe07d7aed Mon Sep 17 00:00:00 2001 From: "Markus \"Holli\" Holzer" Date: Tue, 6 Oct 2020 02:31:48 +0200 Subject: %% for Str --- challenge-081/markus-holzer/raku/ch-1.raku | 10 +++++----- 1 file 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 -- cgit