aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2020-12-16 05:09:06 +0000
committerGitHub <noreply@github.com>2020-12-16 05:09:06 +0000
commitb799a1456474e592554f0945af9904665ece7999 (patch)
treec4b7aad6b84a3c472828e9b48f02e8c6c46e23c1
parent4c4e91b8cc09fbfb152920c0dd23e38747a1efff (diff)
parent71d8c373a0baa9a89db82043e689d3cf56cb2b07 (diff)
downloadperlweeklychallenge-club-b799a1456474e592554f0945af9904665ece7999.tar.gz
perlweeklychallenge-club-b799a1456474e592554f0945af9904665ece7999.tar.bz2
perlweeklychallenge-club-b799a1456474e592554f0945af9904665ece7999.zip
Merge pull request #2995 from stuart-little/stuart-little_016
1st commit on 016
-rw-r--r--challenge-016/stuart-little/README1
-rwxr-xr-xchallenge-016/stuart-little/raku/ch-1.p66
-rwxr-xr-xchallenge-016/stuart-little/raku/ch-2.p621
3 files changed, 28 insertions, 0 deletions
diff --git a/challenge-016/stuart-little/README b/challenge-016/stuart-little/README
new file mode 100644
index 0000000000..78439907de
--- /dev/null
+++ b/challenge-016/stuart-little/README
@@ -0,0 +1 @@
+Solutions by Stuart Little
diff --git a/challenge-016/stuart-little/raku/ch-1.p6 b/challenge-016/stuart-little/raku/ch-1.p6
new file mode 100755
index 0000000000..e62ac2caff
--- /dev/null
+++ b/challenge-016/stuart-little/raku/ch-1.p6
@@ -0,0 +1,6 @@
+#!/usr/bin/env perl6
+use v6;
+
+say ((my $top=(1..*).first({ ($_+1)*($_+2) div 2 > 100})) > 100-$top*($top+1)/2 ) ?? $top !! $top-1
+
+# run as <script>
diff --git a/challenge-016/stuart-little/raku/ch-2.p6 b/challenge-016/stuart-little/raku/ch-2.p6
new file mode 100755
index 0000000000..ed8b4c3ab6
--- /dev/null
+++ b/challenge-016/stuart-little/raku/ch-2.p6
@@ -0,0 +1,21 @@
+#!/usr/bin/env perl6
+use v6;
+
+# run as <script> <address to validate>
+# valid addresses to try (https://perlweeklychallenge.org/blog/perl-weekly-challenge-016/):
+# 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
+# 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy
+
+use HTTP::Tiny;
+
+my $URL='http://www.lenschulwitz.com/base58er';
+my $address=@*ARGS[0];
+
+my $resp=HTTP::Tiny.new;
+say .<content>.decode with $resp.request(
+ 'POST',
+ $URL,
+ content => {
+ address => $address,
+ b58action => 'validate'
+ });