aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2021-04-26 07:10:34 +0100
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2021-04-26 07:10:34 +0100
commit1ff197d81f941c3dd35d77bec8a0326807e8d2b1 (patch)
tree79a4f1decc9d0e66c53661e20a1070d78eaf696c
parent61b87d5ae939ff4bca0d530884cbfebf299c6517 (diff)
parentc6c6dd54406ec4f3f9854b4723a45ccb57e12af6 (diff)
downloadperlweeklychallenge-club-1ff197d81f941c3dd35d77bec8a0326807e8d2b1.tar.gz
perlweeklychallenge-club-1ff197d81f941c3dd35d77bec8a0326807e8d2b1.tar.bz2
perlweeklychallenge-club-1ff197d81f941c3dd35d77bec8a0326807e8d2b1.zip
Merge branch 'master' of https://github.com/manwar/perlweeklychallenge-club
-rwxr-xr-xchallenge-109/maxim-kolodyazhny/raku/ch-2.raku7
1 files changed, 3 insertions, 4 deletions
diff --git a/challenge-109/maxim-kolodyazhny/raku/ch-2.raku b/challenge-109/maxim-kolodyazhny/raku/ch-2.raku
index bc524a2fef..fb1dc3adfe 100755
--- a/challenge-109/maxim-kolodyazhny/raku/ch-2.raku
+++ b/challenge-109/maxim-kolodyazhny/raku/ch-2.raku
@@ -1,8 +1,8 @@
#!/usr/bin/env raku
multi sub MAIN ( $_ where { /\,/ } ) { samewith .split: <,> }
-multi sub MAIN ( $_ where { .unique and .all ~~ /^ \d+ $/ and .elems == 7 }) {
- .permutations
+multi sub MAIN ( *@n where { .unique and .all ~~ /^ \d+ $/ and .elems == 7 }) {
+ @n.permutations
.first({
[==] .rotor( <2 -1 3 -1 3 -1>.pairup )>>.sum
})
@@ -11,9 +11,8 @@ multi sub MAIN ( $_ where { .unique and .all ~~ /^ \d+ $/ and .elems == 7 }) {
sub USAGE() {
print qq:to/EOH/;
- Usage: {$*PROGRAM-NAME} [1,2,3...,7]
+ Usage: {$*PROGRAM-NAME} [1,2,3,...,7] or [1 2 3 ... 7]
Prints the answer for "Four Squares Puzzle"
EOH
}
-