diff options
| author | Simon Proctor <simon.proctor@zpg.co.uk> | 2019-09-16 09:51:49 +0100 |
|---|---|---|
| committer | Simon Proctor <simon.proctor@zpg.co.uk> | 2019-09-16 09:51:49 +0100 |
| commit | 1c687a28d119b667f8e46ff419b8ea09583014d3 (patch) | |
| tree | d2802be0334c7dde66924413f3f7f6cb5e7f421e /challenge-026 | |
| parent | 362dcc0901bb6fba31c7025c74db49fa86194f20 (diff) | |
| download | perlweeklychallenge-club-1c687a28d119b667f8e46ff419b8ea09583014d3.tar.gz perlweeklychallenge-club-1c687a28d119b667f8e46ff419b8ea09583014d3.tar.bz2 perlweeklychallenge-club-1c687a28d119b667f8e46ff419b8ea09583014d3.zip | |
Busy then ill last week but here's a start for this week.
Diffstat (limited to 'challenge-026')
| -rw-r--r-- | challenge-026/simon-proctor/perl6/ch-1.p6 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/challenge-026/simon-proctor/perl6/ch-1.p6 b/challenge-026/simon-proctor/perl6/ch-1.p6 new file mode 100644 index 0000000000..a135a5236b --- /dev/null +++ b/challenge-026/simon-proctor/perl6/ch-1.p6 @@ -0,0 +1,17 @@ +#!/usr/bin/env perl6 + +use v6; + +subset SimpleLetters of Str where * ~~ /^ <[ a..z A..Z ]>+ $/; + +#| Document script +multi sub MAIN( Bool :h(:$help) where ?* ) { say $*USAGE } + +#| print the count of letters in "jewels" there appear in "stones" +multi sub MAIN( + SimpleLetters $stones, #= String to find letters in + SimpleLetters $jewels #= String of letters to look for +) { + my $stone-set = $stones.comb.Set; + $jewels.comb.grep( { $_ (elem) $stone-set } ).elems.say; +} |
