diff options
| -rw-r--r-- | challenge-053/markus-holzer/raku/ch-1.p6 | 5 | ||||
| -rw-r--r-- | challenge-053/markus-holzer/raku/ch-2.p6 | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/challenge-053/markus-holzer/raku/ch-1.p6 b/challenge-053/markus-holzer/raku/ch-1.p6 index c03b8a3b89..678c117972 100644 --- a/challenge-053/markus-holzer/raku/ch-1.p6 +++ b/challenge-053/markus-holzer/raku/ch-1.p6 @@ -1,8 +1,11 @@ +multi sub infix:<times>( Int $n, Callable $b --> Nil ) is looser(&infix:<+>) { &$b($_) for ^$n; } +multi sub infix:<times>( Numeric $n, Callable $b --> Nil ) is looser(&infix:<+>) { &$b($_) for ^($n.Int); } + sub MAIN( Int $degrees where * %% 90, :$size = 3 ) { my @matrix[ $size, $size ] = ( 1..$size² ).batch( $size ); - clockwise( @matrix ) for ^($degrees / 90); + $degrees / 90 times { @matrix.&clockwise }; dd @matrix; } diff --git a/challenge-053/markus-holzer/raku/ch-2.p6 b/challenge-053/markus-holzer/raku/ch-2.p6 index 68f7fb3341..9da4087d36 100644 --- a/challenge-053/markus-holzer/raku/ch-2.p6 +++ b/challenge-053/markus-holzer/raku/ch-2.p6 @@ -1,9 +1,9 @@ my %rules = - :a('e','i'), - :e('i'), - :o('a','u'), - :u('e','o'), - :i('a','e', 'o', 'u') + :a( 'e', 'i' ), + :e( 'i' ), + :i( 'a', 'e', 'o', 'u' ), + :o( 'a', 'u' ), + :u( 'e', 'o' ), ; sub MAIN(Int $n) |
