aboutsummaryrefslogtreecommitdiff
path: root/challenge-016
diff options
context:
space:
mode:
authorchirvasitua <stuart-little@users.noreply.github.com>2020-12-15 09:16:42 -0500
committerchirvasitua <stuart-little@users.noreply.github.com>2020-12-15 09:16:42 -0500
commit71d8c373a0baa9a89db82043e689d3cf56cb2b07 (patch)
tree425d205d66bb6e5b8e10a6c37d38c9b4ab116baa /challenge-016
parent05b96afc64fbcae0ef11b10fd4bd60814cc79211 (diff)
downloadperlweeklychallenge-club-71d8c373a0baa9a89db82043e689d3cf56cb2b07.tar.gz
perlweeklychallenge-club-71d8c373a0baa9a89db82043e689d3cf56cb2b07.tar.bz2
perlweeklychallenge-club-71d8c373a0baa9a89db82043e689d3cf56cb2b07.zip
1st commit on 016
Diffstat (limited to 'challenge-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'
+ });