diff options
| author | Rob4t <robertgratza@web.de> | 2019-04-17 20:31:59 +0200 |
|---|---|---|
| committer | Rob4t <robertgratza@web.de> | 2019-04-17 20:31:59 +0200 |
| commit | c9277841f3aacbc451c0c4e101c4c92891128af3 (patch) | |
| tree | fd9a85b693a674e24c3796ab1fd63bfe8b90a2ae | |
| parent | 690b816b7297aa36e6fc8c82533705089e9c4e0a (diff) | |
| download | perlweeklychallenge-club-c9277841f3aacbc451c0c4e101c4c92891128af3.tar.gz perlweeklychallenge-club-c9277841f3aacbc451c0c4e101c4c92891128af3.tar.bz2 perlweeklychallenge-club-c9277841f3aacbc451c0c4e101c4c92891128af3.zip | |
solution to challenge 004
| -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; + } +} |
