aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2019-04-15 15:09:37 +0100
committerGitHub <noreply@github.com>2019-04-15 15:09:37 +0100
commit0ec295122d488d489c479606b1fc0507f43bbeab (patch)
tree1cc59a60fc345fa1eb4bec69c03f74ace84affa9
parentab2d00a3d22a3498d16b5182f4012d8d18e66dc5 (diff)
parentf8aeea6b0a63b0c0983ec66c799c7b35052ed142 (diff)
downloadperlweeklychallenge-club-0ec295122d488d489c479606b1fc0507f43bbeab.tar.gz
perlweeklychallenge-club-0ec295122d488d489c479606b1fc0507f43bbeab.tar.bz2
perlweeklychallenge-club-0ec295122d488d489c479606b1fc0507f43bbeab.zip
Merge pull request #58 from fjwhittle/master
Challenge 004 part 1 solution
-rw-r--r--challenge-004/fjwhittle/blog.txt1
-rw-r--r--challenge-004/fjwhittle/perl6/ch-1--first.p61
-rw-r--r--challenge-004/fjwhittle/perl6/ch-1.p68
3 files changed, 10 insertions, 0 deletions
diff --git a/challenge-004/fjwhittle/blog.txt b/challenge-004/fjwhittle/blog.txt
new file mode 100644
index 0000000000..55e8085e45
--- /dev/null
+++ b/challenge-004/fjwhittle/blog.txt
@@ -0,0 +1 @@
+https://rage.powered.ninja/2019/04/15/no-pi-file.html
diff --git a/challenge-004/fjwhittle/perl6/ch-1--first.p6 b/challenge-004/fjwhittle/perl6/ch-1--first.p6
new file mode 100644
index 0000000000..7d60b2b87e
--- /dev/null
+++ b/challenge-004/fjwhittle/perl6/ch-1--first.p6
@@ -0,0 +1 @@
+printf "%.16f",pi \ No newline at end of file
diff --git a/challenge-004/fjwhittle/perl6/ch-1.p6 b/challenge-004/fjwhittle/perl6/ch-1.p6
new file mode 100644
index 0000000000..3ae01ddb41
--- /dev/null
+++ b/challenge-004/fjwhittle/perl6/ch-1.p6
@@ -0,0 +1,8 @@
+my $eu-seq = gather {
+ take 1;
+ for 1..* -> $n { take $eu-seq[$n - 1] * FatRat.new($n, 2 * $n + 1) }
+}
+
+my \π := 2 * [+] $eu-seq[^608];
+
+put π.Str.substr: ^($?FILE.IO.s+1);