aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-053/markus-holzer/raku/ch-2.p619
1 files changed, 11 insertions, 8 deletions
diff --git a/challenge-053/markus-holzer/raku/ch-2.p6 b/challenge-053/markus-holzer/raku/ch-2.p6
index 3c3739bbd6..a109be62d3 100644
--- a/challenge-053/markus-holzer/raku/ch-2.p6
+++ b/challenge-053/markus-holzer/raku/ch-2.p6
@@ -1,17 +1,20 @@
my %rules =
- :a('e','i'),
- :e('i'),
- :o('a','u'),
- :u('e','o'),
- :i('a','e', 'o', 'u')
+ :a('e','i'),
+ :e('i'),
+ :o('a','u'),
+ :u('e','o'),
+ :i('a','e', 'o', 'u')
;
sub MAIN(Int $n)
{
- .say for gather { build-str( $n, $_ ) for %rules.keys.sort }
+ .say for gather {
+ build-str( $_, $n )
+ for %rules.keys.sort;
+ }
}
-sub build-str( $n, $current )
+sub build-str( $current, $n )
{
my $last = $current.substr( * - 1 );
@@ -20,7 +23,7 @@ sub build-str( $n, $current )
given $current ~ $_
{
take $_ and next if .chars == $n;
- build-str( $n, $_ );
+ build-str( $_, $n );
}
}
} \ No newline at end of file