aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Wicks <lw@judocoach.com>2021-07-04 11:30:08 +0100
committerGitHub <noreply@github.com>2021-07-04 11:30:08 +0100
commit9e3ad007bc527727b154a31ef2db6f491368715a (patch)
treed1db8a54f7851c2cb70e5b933b5b9075db687c42
parent9736f7fda4ea44b0b41c7aee34bb6b9b62dd023e (diff)
parentc2df644ae21da81cb307729f2a10d77ddc2d1a5e (diff)
downloadperlweeklychallenge-club-9e3ad007bc527727b154a31ef2db6f491368715a.tar.gz
perlweeklychallenge-club-9e3ad007bc527727b154a31ef2db6f491368715a.tar.bz2
perlweeklychallenge-club-9e3ad007bc527727b154a31ef2db6f491368715a.zip
Merge branch 'master' into 119
-rw-r--r--challenge-105/mimosinnet/raku/ch-1.raku39
-rw-r--r--challenge-105/mimosinnet/raku/ch-2.raku56
-rw-r--r--challenge-119/abigail/README.md3
-rw-r--r--challenge-119/abigail/befunge-93/ch-1.bf932
-rw-r--r--challenge-119/abigail/r/ch-1.r20
-rw-r--r--challenge-119/abigail/scheme/ch-1.scm24
-rw-r--r--challenge-119/abigail/tcl/ch-1.tcl13
-rw-r--r--challenge-119/james-smith/README.md26
-rw-r--r--challenge-119/james-smith/cesil/cesil.pl57
-rw-r--r--challenge-119/lance-wicks/blog.txt1
-rw-r--r--challenge-119/mimosinnet/raku/ch-1.raku32
-rw-r--r--challenge-119/mimosinnet/raku/ch-2.raku38
-rw-r--r--challenge-119/mohammad-anwar/perl/ch-1.pl11
-rw-r--r--challenge-119/mohammad-anwar/perl/ch-2.pl13
-rw-r--r--challenge-119/szabgab/crystal/spec/seq_spec.cr10
-rw-r--r--challenge-119/szabgab/crystal/src/list_seq.cr6
-rw-r--r--challenge-119/szabgab/crystal/src/seq.cr15
-rw-r--r--challenge-119/szabgab/crystal/src/use_seq.cr7
-rw-r--r--challenge-119/szabgab/crystal/swap_nibbles.cr10
-rw-r--r--stats/pwc-challenge-105.json239
-rw-r--r--stats/pwc-current.json259
-rw-r--r--stats/pwc-language-breakdown-summary.json58
-rw-r--r--stats/pwc-language-breakdown.json856
-rw-r--r--stats/pwc-leaders.json378
-rw-r--r--stats/pwc-summary-1-30.json34
-rw-r--r--stats/pwc-summary-121-150.json112
-rw-r--r--stats/pwc-summary-151-180.json108
-rw-r--r--stats/pwc-summary-181-210.json42
-rw-r--r--stats/pwc-summary-211-240.json24
-rw-r--r--stats/pwc-summary-31-60.json98
-rw-r--r--stats/pwc-summary-61-90.json44
-rw-r--r--stats/pwc-summary-91-120.json46
-rw-r--r--stats/pwc-summary.json60
33 files changed, 1558 insertions, 1183 deletions
diff --git a/challenge-105/mimosinnet/raku/ch-1.raku b/challenge-105/mimosinnet/raku/ch-1.raku
new file mode 100644
index 0000000000..8217e51f6b
--- /dev/null
+++ b/challenge-105/mimosinnet/raku/ch-1.raku
@@ -0,0 +1,39 @@
+# https://perlweeklychallenge.org/blog/perl-weekly-challenge-105/
+# TASK #1 › Nth root
+
+
+sub challenge( $n, $k ) {
+ return (sprintf '%.2f', $k ** ( 1 / $n)).Num;
+}
+
+multi sub MAIN( $n, $k ) {
+ say 'Input: $N = ',$n,' $k = ',$k;
+ say 'Output: ',challenge($n, $k),"\n";
+}
+
+multi sub MAIN( 'challenge' ) {
+ my @challenge = (
+ (5, 248832),
+ (5, 34)
+ );
+
+ for @challenge -> ($a, $b) {
+ MAIN($a,$b);
+ }
+}
+
+multi sub MAIN( 'test' ) is hidden-from-USAGE {
+ use Test;
+
+ my @test = (
+ (5, 248832, 12),
+ (5, 34, 2.02)
+ );
+
+ for @test -> ($a, $b, $c ) {
+ is challenge($a,$b), $c;
+ }
+
+ done-testing;
+
+}
diff --git a/challenge-105/mimosinnet/raku/ch-2.raku b/challenge-105/mimosinnet/raku/ch-2.raku
new file mode 100644
index 0000000000..343a962fc1
--- /dev/null
+++ b/challenge-105/mimosinnet/raku/ch-2.raku
@@ -0,0 +1,56 @@
+# https://perlweeklychallenge.org/blog/perl-weekly-challenge-105
+# TASK #2 › The Name Game
+
+sub challenge( Str $name ) {
+
+ my $bname = 'b' ~ $name.substr(1);
+ my $fname = 'f' ~ $name.substr(1);
+ my $mname = 'm' ~ $name.substr(1);
+
+ given $name.split("",:skip-empty).head {
+ when 'B' { $bname = $name.substr(1) }
+ when 'F' { $fname = $name.substr(1) }
+ when 'M' { $mname = $name.substr(1) }
+ }
+
+ qq:to/END/;
+ $name, $name, bo-$bname,
+ Bonana-fanna fo-$fname
+ Fee fi mo-$mname
+ $name!
+ END
+
+}
+
+multi sub MAIN( Str $name ) {
+ say 'Input: $name = "',$name,'"';
+ say "Output: \n";
+ say challenge($name);
+}
+
+multi sub MAIN( 'challenge' ) {
+ MAIN('Katie');
+}
+
+multi sub MAIN( 't' ) {
+ challenge('Fred').say;
+}
+
+multi sub MAIN( 'test' ) is hidden-from-USAGE {
+ use Test;
+
+ my @test = (
+ ('Katie', "Katie, Katie, bo-batie,\nBonana-fanna fo-fatie\nFee fi mo-matie\nKatie!\n"),
+ ('Valerie', "Valerie, Valerie, bo-balerie,\nBonana-fanna fo-falerie\nFee fi mo-malerie\nValerie!\n"),
+ ('Billy', "Billy, Billy, bo-illy,\nBonana-fanna fo-filly\nFee fi mo-milly\nBilly!\n"),
+ ('Fred', "Fred, Fred, bo-bred,\nBonana-fanna fo-red\nFee fi mo-mred\nFred!\n"),
+ ('Marsha', "Marsha, Marsha, bo-barsha,\nBonana-fanna fo-farsha\nFee fi mo-arsha\nMarsha!\n")
+ );
+
+ for @test -> ($a, $b) {
+ is challenge($a), $b;
+ }
+
+ done-testing;
+
+}
diff --git a/challenge-119/abigail/README.md b/challenge-119/abigail/README.md
index c2ba036a3f..2fc20d5e68 100644
--- a/challenge-119/abigail/README.md
+++ b/challenge-119/abigail/README.md
@@ -43,7 +43,10 @@ decimal `33`.
* [Pascal](pascal/ch-1.p)
* [Perl](perl/ch-1.pl)
* [Python](python/ch-1.py)
+* [R](r/ch-1.r)
* [Ruby](ruby/ch-1.rb)
+* [Scheme](scheme/ch-1.scm)
+* [Tcl](tcl/ch-1.tcl)
### Blog
[Swap Nibbles](https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-119-1.html)
diff --git a/challenge-119/abigail/befunge-93/ch-1.bf93 b/challenge-119/abigail/befunge-93/ch-1.bf93
index f8bc20d14e..96c1d3c1c9 100644
--- a/challenge-119/abigail/befunge-93/ch-1.bf93
+++ b/challenge-119/abigail/befunge-93/ch-1.bf93
@@ -1 +1 @@
-> & :1+!#@_ : 44* % 44** \ 44*/ + . 55+,
+& :1+!#@_ : 44* % 44** \ 44*/ + . 55+,
diff --git a/challenge-119/abigail/r/ch-1.r b/challenge-119/abigail/r/ch-1.r
new file mode 100644
index 0000000000..27819053fa
--- /dev/null
+++ b/challenge-119/abigail/r/ch-1.r
@@ -0,0 +1,20 @@
+#
+# See ../README.md
+#
+
+#
+# Run as: Rscript ch-1.r < input-file
+#
+
+stdin <- file ('stdin', 'r')
+repeat {
+ n <- readLines (stdin, n = 1)
+ if (length (n) == 0) {
+ break
+ }
+ n = as.integer (n)
+
+ cat (bitwOr (bitwOr (bitwAnd (n, bitwNot (0xFF)),
+ bitwShiftL (bitwAnd (n, 0x0F), 4)),
+ bitwShiftR (bitwAnd (n, 0xF0), 4)), "\n")
+}
diff --git a/challenge-119/abigail/scheme/ch-1.scm b/challenge-119/abigail/scheme/ch-1.scm
new file mode 100644
index 0000000000..8202ca7aaf
--- /dev/null
+++ b/challenge-119/abigail/scheme/ch-1.scm
@@ -0,0 +1,24 @@
+;;;
+;;; See ../README.md
+;;;
+
+;;;
+;;; Run as: guile --no-auto-compile ch-1.scm < input-file
+;;;
+
+
+(use-modules (ice-9 format))
+
+(define (main)
+ (define num (read))
+ (if (not (eof-object? num))
+ (begin
+ (format #t "~d\n" (logior (logand num (lognot #xFF))
+ (ash (logand num #x0F) 4)
+ (ash (logand num #xF0) -4)))
+ (main)
+ )
+ )
+)
+
+(main)
diff --git a/challenge-119/abigail/tcl/ch-1.tcl b/challenge-119/abigail/tcl/ch-1.tcl
new file mode 100644
index 0000000000..cb0b98d6a8
--- /dev/null
+++ b/challenge-119/abigail/tcl/ch-1.tcl
@@ -0,0 +1,13 @@
+#
+# See ../README.md
+#
+
+#
+# Run as: tclsh ch-1.tcl < input-file
+#
+
+while {[gets stdin num] >= 0} {
+ puts [expr ($num & ~0xFF) \
+ | ($num & 0x0F) << 4 \
+ | ($num & 0xF0) >> 4]
+}
diff --git a/challenge-119/james-smith/README.md b/challenge-119/james-smith/README.md
index 8747a9bc7c..3d4b5701ff 100644
--- a/challenge-119/james-smith/README.md
+++ b/challenge-119/james-smith/README.md
@@ -136,34 +136,34 @@ End LINE
Didn't like the idea of relying on JAVA... so here is a bare bones
interpreter...
```perl
-use strict;
-
$| = 1;
my( $ptr, @in, %mem, @code, %ptrs, $reg ) = 0;
my %commands = (
-'LINE' ,sub{print "\n"; },
-'IN' ,sub{die 'OUT OF INPUT' unless @in;$reg=shift@in},
+'LINE' ,sub{print "\n"},
'OUT' ,sub{print $reg},
-'PRINT' ,sub{print $_[0] =~ s{^"}{}r =~ s{"$}{}r; },
-'STORE' ,sub{$mem{$_[0]} = $reg},
-'LOAD' ,sub{$reg = $mem{$_[0]}},
-'HALT' ,sub{exit},
-'JINEG' ,sub{$ptr=$ptrs{$_[0]}-1 if $reg<0},
-'JIZERO' ,sub{$ptr=$ptrs{$_[0]}-1 if $reg==0},
-'JUMP' ,sub{$ptr=$ptrs{$_[0]}-1},
+'PRINT' ,sub{print $_[0]=~s{^"}{}r=~s{"$}{}r;},
+'IN' ,sub{die 'OUT OF INPUT' unless @in;$reg=shift@in},
+'STORE' ,sub{$mem{$_[0]}=$reg},
+'LOAD' ,sub{$reg=$mem{$_[0]}},
'ADD' ,sub{$reg+=$_[0]=~m{^-?\d+$}?$_[0]:$mem{$_[0]}},
'SUBTRACT',sub{$reg-=$_[0]=~m{^-?\d+$}?$_[0]:$mem{$_[0]}},
'MULTIPLY',sub{$reg*=$_[0]=~m{^-?\d+$}?$_[0]:$mem{$_[0]}},
'DIVIDE' ,sub{$reg/=$_[0]=~m{^-?\d+$}?$_[0]:$mem{$_[0]};$reg=int$reg},
+'JINEG' ,sub{$ptr=$ptrs{$_[0]}-1 if $reg<0},
+'JIZERO' ,sub{$ptr=$ptrs{$_[0]}-1 if $reg==0},
+'JUMP' ,sub{$ptr=$ptrs{$_[0]}-1},
+'HALT' ,sub{exit},
);
while(<>) {
(@in = map { 0+$_ } <> ) && last if m{^ {8}%};
($ptrs{$1},$_)=(scalar @code,$2) if m{^(\S{1,7})\s+(.*)};
- push @code, [ split m{\s+}, s{^\s+}{}r =~ s{\s+$}{}r, 2 ];
+ push @code, [ split m{\s+}, s{^\s+}{}r=~s{\s+$}{}r, 2 ];
}
-($commands{$code[$ptr][0]}($code[$ptr][1]),$ptr++) for 1..1e6;
+my $MAX_LOOPS = 1e6;
+($commands{$code[$ptr][0]}($code[$ptr][1]),$ptr++)
+ while --$MAX_LOOPS && $ptr<@code;
```
# Task 2 - Sequence without 1-on-1
diff --git a/challenge-119/james-smith/cesil/cesil.pl b/challenge-119/james-smith/cesil/cesil.pl
index bc1f9613aa..0bbd61888e 100644
--- a/challenge-119/james-smith/cesil/cesil.pl
+++ b/challenge-119/james-smith/cesil/cesil.pl
@@ -1,32 +1,45 @@
use strict;
+use warnings;
$| = 1;
-my( $ptr, @in, %mem, @code, %ptrs, $reg ) = 0;
+my( $ptr, $reg, @in, %mem, @code, %ptrs ) = 0;
-while(<>) {
- (@in = map { 0+$_ } <> ) && last if m{^ {8}%};
- ($ptrs{$1},$_)=(scalar @code,$2) if m{^(\S{1,7})\s+(.*)};
- push @code, [ split m{\s+}, s{^\s+}{}r =~ s{\s+$}{}r, 2 ];
-}
+my %messages = (
+ 'i' => 'No further input',
+ 'm' => 'Unitialized memory at ',
+ 'l' => 'Unknown pointer ',
+);
my %commands = (
- 'LINE' => sub { print "\n"; },
- 'IN' => sub { die "RUN OUT OF INPUT" unless @in; $reg = shift @in; },
- 'OUT' => sub { print $reg },
- 'PRINT' => sub { print $_[0] =~ s{^"}{}r =~ s{"$}{}r; },
- 'STORE' => sub { $mem{$_[0]} = $reg; },
- 'LOAD' => sub { $reg = $mem{$_[0]}; },
- 'HALT' => sub { exit; },
- 'JINEG' => sub { $ptr = $ptrs{$_[0]} - 1 if $reg < 0; },
- 'JIZERO' => sub { $ptr = $ptrs{$_[0]} - 1 if $reg == 0; },
- 'JUMP' => sub { $ptr = $ptrs{$_[0]} - 1; },
- 'ADD' => sub { $reg += ( $_[0]=~m{^-?\d+$} ? $_[0] : $mem{$_[0]} ) },
- 'SUBTRACT' => sub { $reg -= ( $_[0]=~m{^-?\d+$} ? $_[0] : $mem{$_[0]} ) },
- 'MULTIPLY' => sub { $reg *= ( $_[0]=~m{^-?\d+$} ? $_[0] : $mem{$_[0]} ) },
- 'DIVIDE' => sub { $reg /= ( $_[0]=~m{^-?\d+$} ? $_[0] : $mem{$_[0]} ) ; $reg = int $reg; },
+'LINE' ,sub{print "\n"},
+'OUT' ,sub{print $reg},
+'PRINT' ,sub{print $_[0]=~s{^"}{}r=~s{"$}{}r;},
+'IN' ,sub{_err('i') unless @in;$reg=shift@in},
+'STORE' ,sub{$mem{$_[0]}=$reg},
+'LOAD' ,sub{_err('m') unless exists$mem{$_[0]};$reg=$mem{$_[0]}},
+'ADD' ,sub{$reg+=$_[0]=~m{^-?\d+$}?$_[0]:exists$mem{$_[0]}?$mem{$_[0]}:(_err('m'))},
+'SUBTRACT',sub{$reg-=$_[0]=~m{^-?\d+$}?$_[0]:exists$mem{$_[0]}?$mem{$_[0]}:(_err('m'))},
+'MULTIPLY',sub{$reg*=$_[0]=~m{^-?\d+$}?$_[0]:exists$mem{$_[0]}?$mem{$_[0]}:(_err('m'))},
+'DIVIDE' ,sub{$reg/=$_[0]=~m{^-?\d+$}?$_[0]:exists$mem{$_[0]}?$mem{$_[0]}:(_err('m'));$reg=int$reg},
+'JINEG' ,sub{_err('l') unless exists $ptrs{$_[0]}; $ptr=$ptrs{$_[0]}-1 if $reg<0},
+'JIZERO' ,sub{_err('l') unless exists $ptrs{$_[0]}; $ptr=$ptrs{$_[0]}-1 if $reg==0},
+'JUMP' ,sub{_err('l') unless exists $ptrs{$_[0]}; $ptr=$ptrs{$_[0]}-1},
+'HALT' ,sub{exit},
);
-## Execution loop...
-(&{ $commands{$code[$ptr][0]} }( $code[$ptr][1] ),$ptr++) foreach 1..1e6;
+while(<>) {
+ ((@in = map { 0+$_ } <> ),last) if m{^ {8}%};
+ ($ptrs{$1},$_)=(scalar @code,$2) if m{^(\S{1,7})\s+(.*)};
+ my($cmd,$data) = split m{\s+}, s{^\s+}{}r=~s{\s+$}{}r, 2;
+ die "Unknown command [cmd $cmd - line ",1+@code,"]\n" unless exists $commands{$cmd};
+ push @code, [$cmd,$data||''];
+}
+my $MAX_LOOPS = 1e6;
+($commands{$code[$ptr][0]}($code[$ptr][1]),$ptr++)
+ while --$MAX_LOOPS && $ptr<@code;
+sub _err {
+ my $flag = shift;
+ die sprintf "\n%s%s [cmd %s - line %d]\n", $messages{$flag}, $code[$ptr][1], $code[$ptr][0], 1+$ptr;
+}
diff --git a/challenge-119/lance-wicks/blog.txt b/challenge-119/lance-wicks/blog.txt
index a9effbf77e..54eb1e3655 100644
--- a/challenge-119/lance-wicks/blog.txt
+++ b/challenge-119/lance-wicks/blog.txt
@@ -1 +1,2 @@
https://perl.kiwi/tales/2021/07/04/perl-flexibility-for-the-win/
+https://www.twitch.tv/videos/1075491044
diff --git a/challenge-119/mimosinnet/raku/ch-1.raku b/challenge-119/mimosinnet/raku/ch-1.raku
new file mode 100644
index 0000000000..20d4411864
--- /dev/null
+++ b/challenge-119/mimosinnet/raku/ch-1.raku
@@ -0,0 +1,32 @@
+# https://perlweeklychallenge.org/blog/perl-weekly-challenge-119/
+# TASK #1 › Swap Nibbles
+
+sub challenge( $n ) {
+ my @nibble = (sprintf('%08d',$n.base(2)) ~~ / (\d ** 4) (\d ** 4) /).List ;
+ return (@nibble[1].Str ~ @nibble[0].Str).parse-base(2);
+}
+
+multi sub MAIN( $n ) {
+ say 'Input: $N = ',$n;
+ say 'Output: ',challenge($n),"\n";
+}
+
+multi sub MAIN( 'challenge' ) {
+ MAIN(101);
+ MAIN(18);
+}
+
+multi sub MAIN( 'test' ) is hidden-from-USAGE {
+ use Test;
+
+ my @test = (
+ (101, 86),
+ ( 18, 33)
+ );
+
+ for @test -> ($a, $b) {
+ is challenge($a), $b;
+ }
+
+ done-testing;
+}
diff --git a/challenge-119/mimosinnet/raku/ch-2.raku b/challenge-119/mimosinnet/raku/ch-2.raku
new file mode 100644
index 0000000000..9dd285af29
--- /dev/null
+++ b/challenge-119/mimosinnet/raku/ch-2.raku
@@ -0,0 +1,38 @@
+# https://perlweeklychallenge.org/blog/perl-weekly-challenge-119
+# TASK #2 › Sequence without 1-on-1
+
+#|
+sub challenge( UInt $n ) {
+ my Str @numbers = (1..^∞).map({ .base(4) }).grep(none /0 | 11/);
+ return @numbers[ $n -1 ];
+}
+
+multi sub MAIN( UInt $n ) {
+ say 'Input: $N = ',$n;
+ say 'Output: ',challenge($n),"\n";
+}
+
+multi sub MAIN( 'challenge' ) {
+ my UInt @challenge = ( 5, 10, 60 );
+
+ for @challenge -> $a {
+ MAIN($a);
+ }
+}
+
+multi sub MAIN( 'test' ) is hidden-from-USAGE {
+ use Test;
+
+ my @test = (
+ ( 5, 13),
+ (10, 32),
+ (60, 2223)
+ );
+
+ for @test -> ($a, $b) {
+ is challenge($a), $b;
+ }
+
+ done-testing;
+
+}
diff --git a/challenge-119/mohammad-anwar/perl/ch-1.pl b/challenge-119/mohammad-anwar/perl/ch-1.pl
new file mode 100644
index 0000000000..91d20a86b3
--- /dev/null
+++ b/challenge-119/mohammad-anwar/perl/ch-1.pl
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $N = $ARGV[0];
+die "ERROR: Missing input number.\n" unless defined $N;
+die "ERROR: Input number should be > 0 but <= 255.\n" if ($N < 0 or $N > 255);
+
+my $b = sprintf("%08d", sprintf("%b", $N));
+print oct("0b". substr($b, 4) . substr($b, 0, 4)), "\n";
diff --git a/challenge-119/mohammad-anwar/perl/ch-2.pl b/challenge-119/mohammad-anwar/perl/ch-2.pl
new file mode 100644
index 0000000000..3d0c454c8e
--- /dev/null
+++ b/challenge-119/mohammad-anwar/perl/ch-2.pl
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $N = $ARGV[0];
+die "ERROR: Missing input number.\n" unless defined $N;
+die "ERROR: Invalid input number [$N].\n" if ($N < 0);
+
+my $n = 0;
+my $i = 0;
+while (1) { $n++; next if (($n =~ /11/) || ($n =~ /[4567890]/)); $i++; last if ($i == $N); }
+print "$n\n";
diff --git a/challenge-119/szabgab/crystal/spec/seq_spec.cr b/challenge-119/szabgab/crystal/spec/seq_spec.cr
new file mode 100644
index 0000000000..dd2cf9b107
--- /dev/null
+++ b/challenge-119/szabgab/crystal/spec/seq_spec.cr
@@ -0,0 +1,10 @@
+require "spec"
+require "../src/seq"
+
+describe "Seq" do
+ it "verify" do
+ seq(5).should eq(13)
+ seq(10).should eq(32)
+ seq(60).should eq(2223)
+ end
+end
diff --git a/challenge-119/szabgab/crystal/src/list_seq.cr b/challenge-119/szabgab/crystal/src/list_seq.cr
new file mode 100644
index 0000000000..4c6d38f968
--- /dev/null
+++ b/challenge-119/szabgab/crystal/src/list_seq.cr
@@ -0,0 +1,6 @@
+require "./seq"
+
+seq {|num|
+ puts num
+ break if num > 200
+}
diff --git a/challenge-119/szabgab/crystal/src/seq.cr b/challenge-119/szabgab/crystal/src/seq.cr
new file mode 100644
index 0000000000..6ad7778990
--- /dev/null
+++ b/challenge-119/szabgab/crystal/src/seq.cr
@@ -0,0 +1,15 @@
+def seq(&block)
+ val = 0
+ loop do
+ val += 1
+ next if val.to_s =~ /[04-9]|11/
+ yield val
+ end
+end
+
+def seq(n : Int32) : Int32
+ seq {|num|
+ n -= 1
+ return num if n <= 0
+ }
+end
diff --git a/challenge-119/szabgab/crystal/src/use_seq.cr b/challenge-119/szabgab/crystal/src/use_seq.cr
new file mode 100644
index 0000000000..f796c13965
--- /dev/null
+++ b/challenge-119/szabgab/crystal/src/use_seq.cr
@@ -0,0 +1,7 @@
+require "./seq"
+
+if ARGV.size != 1
+ abort("Usage: #{PROGRAM_NAME} NUM", 1)
+end
+
+puts seq(ARGV[0].to_i)
diff --git a/challenge-119/szabgab/crystal/swap_nibbles.cr b/challenge-119/szabgab/crystal/swap_nibbles.cr
new file mode 100644
index 0000000000..80fc725def
--- /dev/null
+++ b/challenge-119/szabgab/crystal/swap_nibbles.cr
@@ -0,0 +1,10 @@
+def swap_nibbles(n)
+ return 16 * (n % 16) + (n // 16)
+end
+
+#puts swap(101)
+#puts swap(18)
+
+(0..255).each {|num|
+ puts "%08b %3s %3s" % {num, num, swap_nibbles(num)}
+}
diff --git a/stats/pwc-challenge-105.json b/stats/pwc-challenge-105.json
index 7bff07402f..62c8a1db32 100644
--- a/stats/pwc-challenge-105.json
+++ b/stats/pwc-challenge-105.json
@@ -1,27 +1,48 @@
{
+ "subtitle" : {
+ "text" : "[Champions: 26] Last updated at 2021-07-04 09:37:10 GMT"
+ },
+ "xAxis" : {
+ "type" : "category"
+ },
+ "chart" : {
+ "type" : "column"
+ },
+ "legend" : {
+ "enabled" : 0
+ },
+ "yAxis" : {
+ "title" : {
+ "text" : "Total Solutions"
+ }
+ },
+ "title" : {
+ "text" : "The Weekly Challenge - 105"
+ },
"series" : [
{
- "name" : "Perl Weekly Challenge - 105",
+ "name" : "The Weekly Challenge - 105",
+ "colorByPoint" : 1,
"data" : [
{
- "drilldown" : "Aaron Smith",
"y" : 3,
+ "drilldown" : "Aaron Smith",
"name" : "Aaron Smith"
},
{
- "y" : 3,
+ "name" : "Abigail",
"drilldown" : "Abigail",
- "name" : "Abigail"
+ "y" : 3
},
{
- "y" : 3,
"drilldown" : "Adam Russell",
- "name" : "Adam Russell"
+ "name" : "Adam Russell",
+ "y" : 3
},
{
"name" : "Arne Sommer",
- "y" : 5,
- "drilldown" : "Arne Sommer"
+ "drilldown" : "Arne Sommer",
+ "y" : 5
},
{
"name" : "Cheok-Yin Fung",
@@ -30,22 +51,22 @@
},
{
"drilldown" : "Colin Crain",
- "y" : 5,
- "name" : "Colin Crain"
+ "name" : "Colin Crain",
+ "y" : 5
},
{
"drilldown" : "Cristina Heredia",
- "y" : 1,
- "name" : "Cristina Heredia"
+ "name" : "Cristina Heredia",
+ "y" : 1
},
{
- "y" : 3,
"drilldown" : "Dave Jacoby",
- "name" : "Dave Jacoby"
+ "name" : "Dave Jacoby",
+ "y" : 3
},
{
- "name" : "Duncan C. White",
"y" : 2,
+ "name" : "Duncan C. White",
"drilldown" : "Duncan C. White"
},
{
@@ -54,29 +75,34 @@
"y" : 2
},
{
+ "drilldown" : "Flavio Poletti",
"name" : "Flavio Poletti",
- "y" : 4,
- "drilldown" : "Flavio Poletti"
+ "y" : 4
},
{
- "name" : "Jaldhar H. Vyas",
"y" : 5,
- "drilldown" : "Jaldhar H. Vyas"
+ "drilldown" : "Jaldhar H. Vyas",
+ "name" : "Jaldhar H. Vyas"
},
{
- "y" : 3,
"drilldown" : "James Smith",
- "name" : "James Smith"
+ "name" : "James Smith",
+ "y" : 3
},
{
- "name" : "Jan Krnavek",
+ "y" : 1,
"drilldown" : "Jan Krnavek",
- "y" : 1
+ "name" : "Jan Krnavek"
},
{
- "name" : "Jorg Sommrey",
"y" : 2,
- "drilldown" : "Jorg Sommrey"
+ "drilldown" : "Joan Mimosinnet",
+ "name" : "Joan Mimosinnet"
+ },
+ {
+ "name" : "Jorg Sommrey",
+ "drilldown" : "Jorg Sommrey",
+ "y" : 2
},
{
"y" : 5,
@@ -89,66 +115,66 @@
"y" : 4
},
{
- "y" : 2,
"drilldown" : "Mark Anderson",
- "name" : "Mark Anderson"
+ "name" : "Mark Anderson",
+ "y" : 2
},
{
- "drilldown" : "Niels van Dijke",
"y" : 1,
- "name" : "Niels van Dijke"
+ "name" : "Niels van Dijke",
+ "drilldown" : "Niels van Dijke"
},
{
+ "name" : "Paulo Custodio",
"drilldown" : "Paulo Custodio",
- "y" : 2,
- "name" : "Paulo Custodio"
+ "y" : 2
},
{
- "name" : "Pete Houston",
"y" : 2,
- "drilldown" : "Pete Houston"
+ "drilldown" : "Pete Houston",
+ "name" : "Pete Houston"
},
{
- "name" : "Roger Bell_West",
"y" : 5,
+ "name" : "Roger Bell_West",
"drilldown" : "Roger Bell_West"
},
{
- "name" : "Stuart Little",
"drilldown" : "Stuart Little",
+ "name" : "Stuart Little",
"y" : 4
},
{
- "name" : "Ulrich Rieke",
+ "y" : 4,
"drilldown" : "Ulrich Rieke",
- "y" : 4
+ "name" : "Ulrich Rieke"
},
{
"drilldown" : "Wanderdoc",
- "y" : 1,
- "name" : "Wanderdoc"
+ "name" : "Wanderdoc",
+ "y" : 1
}
- ],
- "colorByPoint" : 1
+ ]
}
],
- "chart" : {
- "type" : "column"
- },
- "yAxis" : {
- "title" : {
- "text" : "Total Solutions"
+ "plotOptions" : {
+ "series" : {
+ "dataLabels" : {
+ "enabled" : 1,
+ "format" : "{point.y}"
+ },
+ "borderWidth" : 0
}
},
- "xAxis" : {
- "type" : "category"
- },
- "legend" : {
- "enabled" : 0
+ "tooltip" : {
+ "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>",
+ "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>",
+ "followPointer" : 1
},
"drilldown" : {
"series" : [
{
+ "name" : "Aaron Smith",
"data" : [
[
"Raku",
@@ -159,12 +185,10 @@
1
]
],
- "name" : "Aaron Smith",
"id" : "Aaron Smith"
},
{
"id" : "Abigail",
- "name" : "Abigail",
"data" : [
[
"Perl",
@@ -174,10 +198,12 @@
"Blog",
1
]
- ]
+ ],
+ "name" : "Abigail"
},
{
"name" : "Adam Russell",
+ "id" : "Adam Russell",
"data" : [
[
"Perl",
@@ -187,11 +213,10 @@
"Blog",
1
]
- ],
- "id" : "Adam Russell"
+ ]
},
{
- "name" : "Arne Sommer",
+ "id" : "Arne Sommer",
"data" : [
[
"Perl",
@@ -206,17 +231,17 @@
1
]
],
- "id" : "Arne Sommer"
+ "name" : "Arne Sommer"
},
{
"id" : "Cheok-Yin Fung",
- "name" : "Cheok-Yin Fung",
"data" : [
[
"Perl",
1
]
- ]
+ ],
+ "name" : "Cheok-Yin Fung"
},
{