aboutsummaryrefslogtreecommitdiff
path: root/challenge-054/simon-proctor
diff options
context:
space:
mode:
authorSimon Proctor <simon.proctor@zoopla.co.uk>2020-03-31 09:29:15 +0100
committerSimon Proctor <simon.proctor@zoopla.co.uk>2020-03-31 09:29:15 +0100
commitcb54f23a454bc78dd55ddf57b3ced05555466b6e (patch)
tree28d559fff7a6e411de874d1b81fe3fb809cc3f09 /challenge-054/simon-proctor
parent340592c026f33b33d4334ce5ebd561a35b3c943e (diff)
downloadperlweeklychallenge-club-cb54f23a454bc78dd55ddf57b3ced05555466b6e.tar.gz
perlweeklychallenge-club-cb54f23a454bc78dd55ddf57b3ced05555466b6e.tar.bz2
perlweeklychallenge-club-cb54f23a454bc78dd55ddf57b3ced05555466b6e.zip
Add check the k is in the correct range
Diffstat (limited to 'challenge-054/simon-proctor')
-rw-r--r--challenge-054/simon-proctor/raku/ch-1.p62
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-054/simon-proctor/raku/ch-1.p6 b/challenge-054/simon-proctor/raku/ch-1.p6
index 3670fe4fda..54ef95fd78 100644
--- a/challenge-054/simon-proctor/raku/ch-1.p6
+++ b/challenge-054/simon-proctor/raku/ch-1.p6
@@ -3,6 +3,6 @@
use v6;
#| Print the kth permutation of the numbers from 1 to n
-sub MAIN( UInt \n, Int \k where * >= 1 ) {
+sub MAIN( UInt \n, Int \k where { 1 <= k <= [*] 1..n } ) {
(1..n).permutations[k-1].join("").say;
}