Skip to content

Commit 4004d67

Browse files
committed
1st commit on 012
1 parent 26a84b0 commit 4004d67

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

challenge-012/stuart-little/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Stuart Little
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env perl6
2+
use v6;
3+
4+
([\*] (2..*).grep(*.is-prime)).map(*+1).first(! *.is-prime).say
5+
6+
# run as <script>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env perl6
2+
use v6;
3+
4+
my %*SUB-MAIN-OPTS=:named-anywhere,;
5+
sub MAIN(
6+
Str :s(:sep(:$separator)) where *.chars==1 ='/',
7+
*@DIRECTORIES,
8+
) {
9+
@DIRECTORIES[0] ~~ m:exhaustive/(^.*) <?before $separator || $>/;
10+
say $/.map(*.Str).grep(! *.ends-with($separator)).first( -> $dir { @DIRECTORIES.all ~~ /^$dir(\/ || $)/ })
11+
}

0 commit comments

Comments
 (0)