aboutsummaryrefslogtreecommitdiff
path: root/challenge-024
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2019-09-09 01:30:20 +0100
committerGitHub <noreply@github.com>2019-09-09 01:30:20 +0100
commit7b11e2c498af99929c5493809692dc5cca4f0c1c (patch)
tree50055244c1bbc9c4208919f3fec56095268f4547 /challenge-024
parent17b412707aeb51faf68fba4338849ec60c0dbf03 (diff)
parentffc99d05669cd8a6b513366d14b76524fbe1d818 (diff)
downloadperlweeklychallenge-club-7b11e2c498af99929c5493809692dc5cca4f0c1c.tar.gz
perlweeklychallenge-club-7b11e2c498af99929c5493809692dc5cca4f0c1c.tar.bz2
perlweeklychallenge-club-7b11e2c498af99929c5493809692dc5cca4f0c1c.zip
Merge pull request #609 from fjwhittle/master
fjwhittle Challenge 024 solutions
Diffstat (limited to 'challenge-024')
-rw-r--r--challenge-024/fjwhittle/perl6/ch-1.p60
-rw-r--r--challenge-024/fjwhittle/perl6/ch-2.p612
2 files changed, 12 insertions, 0 deletions
diff --git a/challenge-024/fjwhittle/perl6/ch-1.p6 b/challenge-024/fjwhittle/perl6/ch-1.p6
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/challenge-024/fjwhittle/perl6/ch-1.p6
diff --git a/challenge-024/fjwhittle/perl6/ch-2.p6 b/challenge-024/fjwhittle/perl6/ch-2.p6
new file mode 100644
index 0000000000..1b0dc9bb6e
--- /dev/null
+++ b/challenge-024/fjwhittle/perl6/ch-2.p6
@@ -0,0 +1,12 @@
+unit sub MAIN (*@file);
+
+my %index;
+
+for @file.map(*.?IO).grep({.?f && .?r}) -> $file {
+ %index.push:
+ $file.comb(/\w+/, :match).hyper.map({ .Str.fc => $($file.path => .pos,) });
+}
+
+while my $word = prompt 'Find? ' {
+ %index{$word.fc}ยป.say;
+}