diff options
| -rw-r--r-- | challenge-004/rob4t/perl6/ch-1.p6 | 1 | ||||
| -rw-r--r-- | challenge-004/rob4t/perl6/ch-2.p6 | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/challenge-004/rob4t/perl6/ch-1.p6 b/challenge-004/rob4t/perl6/ch-1.p6 new file mode 100644 index 0000000000..d1255dbc34 --- /dev/null +++ b/challenge-004/rob4t/perl6/ch-1.p6 @@ -0,0 +1 @@ +say π;#size 16 diff --git a/challenge-004/rob4t/perl6/ch-2.p6 b/challenge-004/rob4t/perl6/ch-2.p6 new file mode 100644 index 0000000000..e94629df0c --- /dev/null +++ b/challenge-004/rob4t/perl6/ch-2.p6 @@ -0,0 +1,10 @@ +#!/usr/bin/env perl6 +use v6; + +sub MAIN ( Str $file where *.IO.r, *@letters where { .elems > 0 and .all ~~ /^^<:L>$$/ } ) { + my $letterbag = @letters.map({ .comb[0].lc }).Bag; + my @words = $file.IO.lines( :chomp ).map({ .words[0].lc }); + for @words -> $word { + say $word if $word.comb.Bag ⊆ $letterbag; + } +} |
