aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus "Holli" Holzer <holli.holzer@gmail.com>2020-03-23 23:28:33 +0100
committerMarkus "Holli" Holzer <holli.holzer@gmail.com>2020-03-23 23:28:33 +0100
commitd1c7d682e5bb7dcb7602e80a815491e78859a7f8 (patch)
tree7b333f12892e3fd4dd1fbb0948f8bafdd5ba841e
parent2f31233bfa14def4472a8132826b1f34bff133df (diff)
downloadperlweeklychallenge-club-d1c7d682e5bb7dcb7602e80a815491e78859a7f8.tar.gz
perlweeklychallenge-club-d1c7d682e5bb7dcb7602e80a815491e78859a7f8.tar.bz2
perlweeklychallenge-club-d1c7d682e5bb7dcb7602e80a815491e78859a7f8.zip
final
-rw-r--r--challenge-053/markus-holzer/raku/ch-1.p65
-rw-r--r--challenge-053/markus-holzer/raku/ch-2.p610
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)