aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus "Holli" Holzer <holli.holzer@gmail.com>2020-03-23 19:52:46 +0100
committerMarkus "Holli" Holzer <holli.holzer@gmail.com>2020-03-23 19:52:46 +0100
commitd07e5af5425d7c198a5e0d24db8d1444ccc647b0 (patch)
tree06a273229c84f034118170346a099c84b8210cad
parentf7f2f2dbbad9aae326b5f4e84a6730e65ab6a579 (diff)
downloadperlweeklychallenge-club-d07e5af5425d7c198a5e0d24db8d1444ccc647b0.tar.gz
perlweeklychallenge-club-d07e5af5425d7c198a5e0d24db8d1444ccc647b0.tar.bz2
perlweeklychallenge-club-d07e5af5425d7c198a5e0d24db8d1444ccc647b0.zip
improvities
-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