aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-004/jo-christian-oterhals/blog.txt1
-rw-r--r--challenge-004/jo-christian-oterhals/perl5/ch-1.pl6
-rw-r--r--challenge-004/jo-christian-oterhals/perl6/ch-1.p65
-rw-r--r--challenge-004/jo-christian-oterhals/perl6/ch-2.p617
4 files changed, 29 insertions, 0 deletions
diff --git a/challenge-004/jo-christian-oterhals/blog.txt b/challenge-004/jo-christian-oterhals/blog.txt
new file mode 100644
index 0000000000..8a154b3848
--- /dev/null
+++ b/challenge-004/jo-christian-oterhals/blog.txt
@@ -0,0 +1 @@
+https://medium.com/@jcoterhals/perl-6-small-stuff-17-a-weekly-challenge-of-big-pis-bags-and-modules-6c6c0867cb0a
diff --git a/challenge-004/jo-christian-oterhals/perl5/ch-1.pl b/challenge-004/jo-christian-oterhals/perl5/ch-1.pl
new file mode 100644
index 0000000000..4ba99c8189
--- /dev/null
+++ b/challenge-004/jo-christian-oterhals/perl5/ch-1.pl
@@ -0,0 +1,6 @@
+#!/usr/bin/env perl
+
+use v5.18;
+use Math::BigFloat 'bpi';
+
+say bpi(-s $ARGV[0]);
diff --git a/challenge-004/jo-christian-oterhals/perl6/ch-1.p6 b/challenge-004/jo-christian-oterhals/perl6/ch-1.p6
new file mode 100644
index 0000000000..97c5d21a65
--- /dev/null
+++ b/challenge-004/jo-christian-oterhals/perl6/ch-1.p6
@@ -0,0 +1,5 @@
+#!/usr/bin/env perl6
+
+use BigPI;
+
+say BigPI::pi $?FILE.IO.s;
diff --git a/challenge-004/jo-christian-oterhals/perl6/ch-2.p6 b/challenge-004/jo-christian-oterhals/perl6/ch-2.p6
new file mode 100644
index 0000000000..09daf599ff
--- /dev/null
+++ b/challenge-004/jo-christian-oterhals/perl6/ch-2.p6
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl6
+
+my $letters = ( gather for 1..500 { take ('a'..'z').pick } ).BagHash;
+
+say ([+] $letters.values) ~ " letters matches...";
+
+for "random-2000.dict".IO.lines.sort({ rand }) -> $word {
+ my $wbh = $word.lc.comb.BagHash;
+ if ($wbh (<=) $letters) {
+ $letters = $letters (-) $wbh;
+ say "\t" ~ $word;
+ }
+}
+
+say ([+] $letters.values) ~ " letters remain.";
+
+