diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2021-06-26 22:33:01 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2021-06-26 22:33:01 +0100 |
| commit | 0d0d5481ca9a3f18403eb433a8b00df549892773 (patch) | |
| tree | 25c0a8c5e84ce26212c5995d49f0f4fefe4aa145 | |
| parent | 591dae4c8b7fff697c7baafd3531729e68faa79b (diff) | |
| download | perlweeklychallenge-club-0d0d5481ca9a3f18403eb433a8b00df549892773.tar.gz perlweeklychallenge-club-0d0d5481ca9a3f18403eb433a8b00df549892773.tar.bz2 perlweeklychallenge-club-0d0d5481ca9a3f18403eb433a8b00df549892773.zip | |
- Added solutions by Arne Sommer.
| -rw-r--r-- | challenge-118/arne-sommer/blog.txt | 1 | ||||
| -rw-r--r-- | challenge-118/arne-sommer/perl/ch-1.pl | 20 | ||||
| -rw-r--r-- | challenge-118/arne-sommer/raku/ch-1.raku | 9 | ||||
| -rw-r--r-- | challenge-118/arne-sommer/raku/ch-2.raku | 62 | ||||
| -rw-r--r-- | stats/pwc-current.json | 353 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 82 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 1574 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 380 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 44 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 106 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 98 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 84 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 40 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 34 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 32 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 102 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 484 |
17 files changed, 1810 insertions, 1695 deletions
diff --git a/challenge-118/arne-sommer/blog.txt b/challenge-118/arne-sommer/blog.txt new file mode 100644 index 0000000000..f3efbb4875 --- /dev/null +++ b/challenge-118/arne-sommer/blog.txt @@ -0,0 +1 @@ +https://raku-musings.com/binary-knight.html diff --git a/challenge-118/arne-sommer/perl/ch-1.pl b/challenge-118/arne-sommer/perl/ch-1.pl new file mode 100644 index 0000000000..1f64526fab --- /dev/null +++ b/challenge-118/arne-sommer/perl/ch-1.pl @@ -0,0 +1,20 @@ +#! /usr/bin/env perl + +use strict; +use warnings; +use feature 'say'; + +use Getopt::Long; +my $verbose = 0; + +GetOptions("verbose" => \$verbose); + +my $N = shift(@ARGV); + +die "Specify a positive integer" unless $N =~ /^[1-9]\d*$/; + +my $bin = sprintf('%b', $N); + +say ": $bin (binary)\n: " . reverse($bin) . " (binary flipped)" if $verbose; + +say 0 + ($bin eq reverse($bin));
\ No newline at end of file diff --git a/challenge-118/arne-sommer/raku/ch-1.raku b/challenge-118/arne-sommer/raku/ch-1.raku new file mode 100644 index 0000000000..1daa749dca --- /dev/null +++ b/challenge-118/arne-sommer/raku/ch-1.raku @@ -0,0 +1,9 @@ +#! /usr/bin/env raku + +unit sub MAIN (Int $N where $N > 0, :v($verbose)); + +my $bin = $N.fmt('%b'); + +say ": $bin (binary)\n: { $bin.flip } (binary flipped)" if $verbose; + +say + ($bin eq $bin.flip);
\ No newline at end of file diff --git a/challenge-118/arne-sommer/raku/ch-2.raku b/challenge-118/arne-sommer/raku/ch-2.raku new file mode 100644 index 0000000000..9d8b8fac0d --- /dev/null +++ b/challenge-118/arne-sommer/raku/ch-2.raku @@ -0,0 +1,62 @@ +#! /usr/bin/env raku + +subset ChessPos of Str where + $_.chars == 2 && + $_.substr(0,1) ~~ /<[abcdefgh]>/ && + $_.substr(1,1) ~~ /<[12345678]>/; + +unit sub MAIN (ChessPos $pos = 'a8', :v($verbose)); + +my ($col, $row) = $pos.comb; + +my %treasures = ('e6' => True, 'c4' => True, 'b3' => True, + 'a2' => True, 'b2' => True, 'b1' => True); + +my %visited = ('a8' => True); + +my @todo = ( ('a8', 'a8', {%visited}, {%treasures}), ); + +while @todo +{ + my $next = @todo.shift; + my ($pos, $path, $visited, $treasures) = @($next); + my %visited = %($visited); + my %treasures = %($treasures); + + for get-next($pos) -> $next + { + say ": Checking pos: $next (at path \'$path\') with { %visited.elems } visits and { %treasures.elems } remaining treasures" if $verbose; + next if %visited{$next}; + + if %treasures{$next} + { + if %treasures.elems == 1 + { + say "Path: $path $next"; + exit; + } + + %treasures{$next}:delete; + } + %visited{$next} = True; + @todo.push: ($next, "$path $next", {%visited}, {%treasures}); + } +} + +sub get-next ($pos) +{ + my ($col, $row) = $pos.comb; + + my @next = ( + "{ ($col.ord - 2).chr }{ $row - 1 }", # LLD + "{ ($col.ord - 2).chr }{ $row + 1 }", # LLU + "{ ($col.ord - 1).chr }{ $row - 2 }", # LDD + "{ ($col.ord - 1).chr }{ $row + 2 }", # LUU + "{ ($col.ord + 1).chr }{ $row - 2 }", # RDD + "{ ($col.ord + 1).chr }{ $row + 2 }", # RUU + "{ ($col.ord + 2).chr }{ $row - 1 }", # RRD + "{ ($col.ord + 2).chr }{ $row + 1 }", # RRU + ).grep( * ~~ ChessPos); + + return @next; +}
\ No newline at end of file diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 2c371cd18c..bbd9b84f8a 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,21 +1,174 @@ { + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, + "subtitle" : { + "text" : "[Champions: 21] Last updated at 2021-06-26 21:27:51 GMT" + }, "title" : { "text" : "Perl Weekly Challenge - 118" }, + "chart" : { + "type" : "column" + }, + "tooltip" : { + "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>", + "followPointer" : 1, + "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>" + }, + "xAxis" : { + "type" : "category" + }, + "series" : [ + { + "colorByPoint" : 1, + "data" : [ + { + "y" : 4, + "drilldown" : "Arne Sommer", + "name" : "Arne Sommer" + }, + { + "drilldown" : "Cheok-Yin Fung", + "y" : 2, + "name" : "Cheok-Yin Fung" + }, + { + "name" : "Dave Jacoby", + "y" : 3, + "drilldown" : "Dave Jacoby" + }, + { + "name" : "Duane Powell", + "y" : 2, + "drilldown" : "Duane Powell" + }, + { + "name" : "E. Choroba", + "drilldown" : "E. Choroba", + "y" : 2 + }, + { + "name" : "Flavio Poletti", + "y" : 6, + "drilldown" : "Flavio Poletti" + }, + { + "y" : 3, + "drilldown" : "James Smith", + "name" : "James Smith" + }, + { + "name" : "Jorg Sommrey", + "y" : 2, + "drilldown" : "Jorg Sommrey" + }, + { + "name" : "Lance Wicks", + "drilldown" : "Lance Wicks", + "y" : 3 + }, + { + "name" : "Laurent Rosenfeld", + "drilldown" : "Laurent Rosenfeld", + "y" : 3 + }, + { + "name" : "Lucas Ransan", + "drilldown" : "Lucas Ransan", + "y" : 2 + }, + { + "name" : "Mohammad S Anwar", + "drilldown" : "Mohammad S Anwar", + "y" : 1 + }, + { + "name" : "Niels van Dijke", + "y" : 1, + "drilldown" : "Niels van Dijke" + }, + { + "drilldown" : "Paulo Custodio", + "y" : 2, + "name" : "Paulo Custodio" + }, + { + "y" : 2, + "drilldown" : "Pete Houston", + "name" : "Pete Houston" + }, + { + "y" : 4, + "drilldown" : "Roger Bell_West", + "name" : "Roger Bell_West" + }, + { + "y" : 3, + "drilldown" : "Simon Green", + "name" : "Simon Green" + }, + { + "drilldown" : "Steven Wilson", + "y" : 1, + "name" : "Steven Wilson" + }, + { + "y" : 4, + "drilldown" : "Stuart Little", + "name" : "Stuart Little" + }, + { + "name" : "Vinod Kumar K", + "drilldown" : "Vinod Kumar K", + "y" : 1 + }, + { + "y" : 3, + "drilldown" : "W. Luis Mochan", + "name" : "W. Luis Mochan" + } + ], + "name" : "Perl Weekly Challenge - 118" + } + ], "drilldown" : { "series" : [ { - "id" : "Cheok-Yin Fung", + "data" : [ + [ + "Perl", + 1 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Arne Sommer", + "id" : "Arne Sommer" + }, + { "data" : [ [ "Perl", 2 ] ], - "name" : "Cheok-Yin Fung" + "name" : "Cheok-Yin Fung", + "id" : "Cheok-Yin Fung" }, { - "id" : "Dave Jacoby", "name" : "Dave Jacoby", "data" : [ [ @@ -26,31 +179,31 @@ "Blog", 1 ] - ] + ], + "id" : "Dave Jacoby" }, { - "name" : "Duane Powell", + "id" : "Duane Powell", "data" : [ [ "Perl", 2 ] ], - "id" : "Duane Powell" + "name" : "Duane Powell" }, { "id" : "E. Choroba", - "name" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "E. Choroba" }, { "id" : "Flavio Poletti", - "name" : "Flavio Poletti", "data" : [ [ "Perl", @@ -64,9 +217,11 @@ "Blog", 2 ] - ] + ], + "name" : "Flavio Poletti" }, { + "id" : "James Smith", "data" : [ [ "Perl", @@ -77,18 +232,17 @@ 1 ] ], - "name" : "James Smith", - "id" : "James Smith" + "name" : "James Smith" }, { + "id" : "Jorg Sommrey", "name" : "Jorg Sommrey", "data" : [ [ "Perl", 2 ] - ], - "id" : "Jorg Sommrey" + ] }, { "name" : "Lance Wicks", @@ -105,6 +259,7 @@ "id" : "Lance Wicks" }, { + "id" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -119,18 +274,17 @@ 1 ] ], - "name" : "Laurent Rosenfeld", - "id" : "Laurent Rosenfeld" + "name" : "Laurent Rosenfeld" }, { "id" : "Lucas Ransan", + "name" : "Lucas Ransan", "data" : [ [ "Raku", 2 ] - ], - "name" : "Lucas Ransan" + ] }, { "id" : "Mohammad S Anwar", @@ -143,34 +297,34 @@ "name" : "Mohammad S Anwar" }, { - "id" : "Niels van Dijke", "data" : [ [ "Perl", 1 ] ], - "name" : "Niels van Dijke" + "name" : "Niels van Dijke", + "id" : "Niels van Dijke" }, { - "id" : "Paulo Custodio", - "name" : "Paulo Custodio", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Paulo Custodio", + "id" : "Paulo Custodio" }, { - "id" : "Pete Houston", "data" : [ [ "Perl", 2 ] ], - "name" : "Pete Houston" + "name" : "Pete Houston", + "id" : "Pete Houston" }, { "id" : "Roger Bell_West", @@ -191,7 +345,6 @@ "name" : "Roger Bell_West" }, { - "name" : "Simon Green", "data" : [ [ "Perl", @@ -202,19 +355,21 @@ 1 ] ], + "name" : "Simon Green", "id" : "Simon Green" }, { + "id" : "Steven Wilson", + "name" : "Steven Wilson", "data" : [ [ "Perl", 1 ] - ], - "name" : "Steven Wilson", - "id" : "Steven Wilson" + ] }, { + "id" : "Stuart Little", "name" : "Stuart Little", "data" : [ [ @@ -225,8 +380,7 @@ "Raku", 2 ] - ], - "id" : "Stuart Little" + ] }, { "data" : [ @@ -239,6 +393,8 @@ "id" : "Vinod Kumar K" }, { + "id" : "W. Luis Mochan", + "name" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -248,149 +404,16 @@ "Blog", 1 ] - ], - "name" : "W. Luis Mochan", - "id" : "W. Luis Mochan" + ] } ] }, - "tooltip" : { - "followPointer" : 1, - "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/>" - }, "legend" : { "enabled" : 0 }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - } - } - }, - "series" : [ - { - "colorByPoint" : 1, - "data" : [ - { - "y" : 2, - "name" : "Cheok-Yin Fung", - "drilldown" : "Cheok-Yin Fung" - }, - { - "name" : "Dave Jacoby", - "y" : 3, - "drilldown" : "Dave Jacoby" - }, - { - "drilldown" : "Duane Powell", - "y" : 2, - "name" : "Duane Powell" - }, - { - "name" : "E. Choroba", - "y" : 2, - "drilldown" : "E. Choroba" - }, - { - "drilldown" : "Flavio Poletti", - "name" : "Flavio Poletti", - "y" : 6 - }, - { - "y" : 3, - "name" : "James Smith", - "drilldown" : "James Smith" - }, - { - "drilldown" : "Jorg Sommrey", - "y" : 2, - "name" : "Jorg Sommrey" - }, - { - "name" : "Lance Wicks", - "y" : 3, - "drilldown" : "Lance Wicks" - }, - { - "y" : 3, - "name" : "Laurent Rosenfeld", - "drilldown" : "Laurent Rosenfeld" - }, - { - "drilldown" : "Lucas Ransan", - "name" : "Lucas Ransan", - "y" : 2 - }, - { - "drilldown" : "Mohammad S Anwar", - "y" : 1, - "name" : "Mohammad S Anwar" - }, - { - "drilldown" : "Niels van Dijke", - "name" : "Niels van Dijke", - "y" : 1 - }, - { - "y" : 2, - "name" : "Paulo Custodio", - "drilldown" : "Paulo Custodio" - }, - { - "y" : 2, - "name" : "Pete Houston", - "drilldown" : "Pete Houston" - }, - { - "drilldown" : "Roger Bell_West", - "name" : "Roger Bell_West", - "y" : 4 - }, - { - "drilldown" : "Simon Green", - "name" : "Simon Green", - "y" : 3 - }, - { - "drilldown" : "Steven Wilson", - "name" : "Steven Wilson", - "y" : 1 - }, - { - "drilldown" : "Stuart Little", - "name" : "Stuart Little", - "y" : 4 - }, - { - "drilldown" : "Vinod Kumar K", - "name" : "Vinod Kumar K", - "y" : 1 - }, - { - "y" : 3, - "name" : "W. Luis Mochan", - "drilldown" : "W. Luis Mochan" - } - ], - "name" : "Perl Weekly Challenge - 118" - } - ], "yAxis" : { "title" : { "text" : "Total Solutions" } - }, - "subtitle" : { - "text" : "[Champions: 20] Last updated at 2021-06-26 10:39:08 GMT" - }, - "chart" : { - "type" : "column" - }, - "xAxis" : { - "type" : "category" } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index a70a4f2bcc..c3da45e99e 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,63 +1,63 @@ { + "subtitle" : { + "text" : "Last updated at 2021-06-26 21:27:51 GMT" + }, + "title" : { + "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" + }, + "chart" : { + "type" : "column" + }, + "xAxis" : { + "labels" : { + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + } + }, + "type" : "category" + }, + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" + }, + "yAxis" : { + "min" : 0, + "title" : { + "text" : null + } + }, + "legend" : { + "enabled" : "false" + }, "series" : [ { + "name" : "Contributions", "data" : [ [ "Blog", - 1669 + 1670 ], [ "Perl", - 5602 + 5603 ], [ "Raku", - 3530 + 3532 ] ], "dataLabels" : { - "format" : "{point.y:.0f}", "y" : 10, - "enabled" : "true", "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" }, - "rotation" : -90, + "format" : "{point.y:.0f}", "align" : "right", + "rotation" : -90, + "enabled" : "true", "color" : "#FFFFFF" - }, - "name" : "Contributions" - } - ], - "yAxis" : { - "title" : { - "text" : null - }, - "min" : 0 - }, - "xAxis" : { - "labels" : { - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" } - }, - "type" : "category" - }, - "chart" : { - "type" : "column" - }, - "subtitle" : { - "text" : "Last updated at 2021-06-26 10:39:08 GMT" - }, - "legend" : { - "enabled" : "false" - }, - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" - }, - "title" : { - "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" - } + } + ] } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 84324a9085..2d2f5efc99 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,17 +1,614 @@ { + "series" : [ + { + "colorByPoint" : "true", + "name" : "Perl Weekly Challenge Languages", + "data" : [ + { + "name" : "#001", + "y" : 161, + "drilldown" : "001" + }, + { + "y" : 125, + "drilldown" : "002", + "name" : "#002" + }, + { + "y" : 81, + "drilldown" : "003", + "name" : "#003" + }, + { + "name" : "#004", + "drilldown" : "004", + "y" : 99 + }, + { + "drilldown" : "005", + "y" : 78, + "name" : "#005" + }, + { + "y" : 58, + "drilldown" : "006", + "name" : "#006" + }, + { + "y" : 64, + "drilldown" : "007", + "name" : "#007" + }, + { + "name" : "#008", + "y" : 78, + "drilldown" : "008" + }, + { + "name" : "#009", + "drilldown" : "009", + "y" : 76 + }, + { + "name" : "#010", + "drilldown" : "010", + "y" : 65 + }, + { + "name" : "#011", + "drilldown" : "011", + "y" : 85 + }, + { + "y" : 89, + "drilldown" : "012", + "name" : "#012" + }, + { + "y" : 85, + "drilldown" : "013", + "name" : "#013" + }, + { + "name" : "#014", + "drilldown" : "014", + "y" : 101 + }, + { + "name" : "#015", + "y" : 99, + "drilldown" : "015" + }, + { + "name" : "#016", + "drilldown" : "016", + "y" : 71 + }, + { + "drilldown" : "017", + "y" : 84, + "name" : "#017" + }, + { + "name" : "#018", + "y" : 81, + "drilldown" : "018" + }, + { + "name" : "#019", + "drilldown" : "019", + "y" : 103 + }, + { + "y" : 101, + "drilldown" : "020", + "name" : "#020" + }, + { + "drilldown" : "021", + "y" : 72, + "name" : "#021" + }, + { + "drilldown" : "022", + "y" : 68, + "name" : "#022" + }, + { + "name" : "#023", + "drilldown" : "023", + "y" : 97 + }, + { + "name" : "#024", + "drilldown" : "024", + "y" : 74 + }, + { + "name" : "#025", + "drilldown" : "025", + "y" : 59 + }, + { + "drilldown" : "026", + "y" : 74, + "name" : "#026" + }, + { + "y" : 60, + "drilldown" : "027", + "name" : "#027" + }, + { + "y" : 80, + "drilldown" : "028", + "name" : "#028" + }, + { + "drilldown" : "029", + "y" : 79, + "name" : "#029" + }, + { + "name" : "#030", + "drilldown" : "030", + "y" : 117 + }, + { + "name" : "#031", + "drilldown" : "031", + "y" : 89 + }, + { + "name" : "#032", + "drilldown" : "032", + "y" : 94 + }, + { + "name" : "#033", + "drilldown" : "033", + "y" : 110 + }, + { + "name" : "#034", + "drilldown" : "034", + "y" : 64 + }, + { + "drilldown" : "035", + "y" : 64, + "name" : "#035" + }, + { + "name" : "#036", + "y" : 68, + "drilldown" : "036" + }, + { + "drilldown" : "037", + "y" : 67, + "name" : "#037" + }, + { + "drilldown" : "038", + "y" : 68, + "name" : "#038" + }, + { + "name" : "#039", + "y" : 62, + "drilldown" : "039" + }, + { + "y" : 73, + "drilldown" : "040", + "name" : "#040" + }, + { + "name" : "#041", + "y" : 76, + "drilldown" : "041" + }, + { + "name" : "#042", + "y" : 92, + "drilldown" : "042" + }, + { + "name" : "#043", + "drilldown" : "043", + "y" : 68 + }, + { + "name" : "#044", + "drilldown" : "044", + "y" : 85 + }, + { + "y" : 96, + "drilldown" : "045", + "name" : "#045" + }, + { + "drilldown" : "046", + "y" : 87, + "name" : "#046" + }, + { + "y" : 84, + "drilldown" : "047", + "name" : "#047" + }, + { + "drilldown" : "048", + "y" : 108, + "name" : "#048" + }, + { + "name" : "#049", + "y" : 89, + "drilldown" : "049" + }, + { + "drilldown" : "050", + "y" : 98, + "name" : "#050" + }, + { + "name" : "#051", + "drilldown" : "051", + "y" : 89 + }, + { + "drilldown" : "052", + "y" : 91, + "name" : "#052" + }, + { + "name" : "#053", + "y" : 101, + "drilldown" : "053" + }, + { + "y" : 103, + "drilldown" : "054", + "name" : "#054" + }, + { + "drilldown" : "055", + "y" : 88, + "name" : "#055" + }, + { + "name" : "#056", + "y" : 95, + "drilldown" : "056" + }, + { + "drilldown" : "057", + "y" : 80, + "name" : "#057" + }, + { + "name" : "#058", + "drilldown" : "058", + "y" : 69 + }, + { + "drilldown" : "059", + "y" : 89 |
