diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2020-02-25 11:18:11 +0000 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2020-02-25 11:18:11 +0000 |
| commit | 82d6696419db53bb008faadf5de6df30c64f3cc3 (patch) | |
| tree | 533a26b86a8b2539bf743637365506ec43fc4d0b | |
| parent | 2c5c35db84a34508088bf78eb9db621f6cfd9d3d (diff) | |
| download | perlweeklychallenge-club-82d6696419db53bb008faadf5de6df30c64f3cc3.tar.gz perlweeklychallenge-club-82d6696419db53bb008faadf5de6df30c64f3cc3.tar.bz2 perlweeklychallenge-club-82d6696419db53bb008faadf5de6df30c64f3cc3.zip | |
- Added solutions by E. Choroba.
| -rwxr-xr-x | challenge-049/e-choroba/perl/ch-1.pl | 14 | ||||
| -rwxr-xr-x | challenge-049/e-choroba/perl/ch-1a.pl | 20 | ||||
| -rwxr-xr-x | challenge-049/e-choroba/perl/ch-1b.pl | 28 | ||||
| -rw-r--r-- | stats/pwc-current.json | 151 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 56 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 734 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 714 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 112 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 50 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 42 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 40 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 102 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 42 |
13 files changed, 1060 insertions, 1045 deletions
diff --git a/challenge-049/e-choroba/perl/ch-1.pl b/challenge-049/e-choroba/perl/ch-1.pl new file mode 100755 index 0000000000..fe8f988745 --- /dev/null +++ b/challenge-049/e-choroba/perl/ch-1.pl @@ -0,0 +1,14 @@ +#!/usr/bin/perl +use warnings; +use strict; +use feature qw{ say }; + +my $x = shift; +say smallest_multiple($x); + +sub smallest_multiple { + my ($n) = @_; + my $r = $n; + $r += $n until $r =~ /^[01]+$/; + $r +} diff --git a/challenge-049/e-choroba/perl/ch-1a.pl b/challenge-049/e-choroba/perl/ch-1a.pl index fe8f988745..84fc5c711c 100755 --- a/challenge-049/e-choroba/perl/ch-1a.pl +++ b/challenge-049/e-choroba/perl/ch-1a.pl @@ -8,7 +8,21 @@ say smallest_multiple($x); sub smallest_multiple { my ($n) = @_; - my $r = $n; - $r += $n until $r =~ /^[01]+$/; - $r + return 0 unless $n; + + my $binary = 1 . (0 x (length($n) - 1)); + increment($binary) while $binary % $n; + $binary +} + +sub increment { + my $pos = rindex $_[0], 0; + if ($pos > -1) { + substr $_[0], $pos, 1, '1'; + substr $_[0], $pos + 1, length($_[0]) - $pos - 1, + '0' x (length($_[0]) - $pos - 1); + } else { + $_[0] = '1' . ('0' x length $_[0]); + } } + diff --git a/challenge-049/e-choroba/perl/ch-1b.pl b/challenge-049/e-choroba/perl/ch-1b.pl deleted file mode 100755 index 84fc5c711c..0000000000 --- a/challenge-049/e-choroba/perl/ch-1b.pl +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/perl -use warnings; -use strict; -use feature qw{ say }; - -my $x = shift; -say smallest_multiple($x); - -sub smallest_multiple { - my ($n) = @_; - return 0 unless $n; - - my $binary = 1 . (0 x (length($n) - 1)); - increment($binary) while $binary % $n; - $binary -} - -sub increment { - my $pos = rindex $_[0], 0; - if ($pos > -1) { - substr $_[0], $pos, 1, '1'; - substr $_[0], $pos + 1, length($_[0]) - $pos - 1, - '0' x (length($_[0]) - $pos - 1); - } else { - $_[0] = '1' . ('0' x length $_[0]); - } -} - diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 6a6bdfcf9f..f07447edb5 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,12 +1,74 @@ { + "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/>" + }, + "series" : [ + { + "colorByPoint" : 1, + "data" : [ + { + "name" : "E. Choroba", + "drilldown" : "E. Choroba", + "y" : 2 + }, + { + "name" : "Luca Ferrari", + "y" : 4, + "drilldown" : "Luca Ferrari" + }, + { + "name" : "Mohammad S Anwar", + "y" : 3, + "drilldown" : "Mohammad S Anwar" + }, + { + "name" : "Peter Scott", + "y" : 1, + "drilldown" : "Peter Scott" + }, + { + "name" : "Roger Bell West", + "y" : 4, + "drilldown" : "Roger Bell West" + }, + { + "name" : "Simon Proctor", + "y" : 2, + "drilldown" : "Simon Proctor" + }, + { + "drilldown" : "Wanderdoc", + "y" : 2, + "name" : "Wanderdoc" + } + ], + "name" : "Perl Weekly Challenge - 049" + } + ], "yAxis" : { "title" : { "text" : "Total Solutions" } }, + "xAxis" : { + "type" : "category" + }, "drilldown" : { "series" : [ { + "id" : "E. Choroba", + "name" : "E. Choroba", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -17,11 +79,10 @@ 2 ] ], - "name" : "Luca Ferrari", - "id" : "Luca Ferrari" + "name" : "Luca Ferrari" }, { - "name" : "Mohammad S Anwar", + "id" : "Mohammad S Anwar", "data" : [ [ "Perl", @@ -32,19 +93,21 @@ 1 ] ], - "id" : "Mohammad S Anwar" + "name" : "Mohammad S Anwar" }, { + "id" : "Peter Scott", "data" : [ [ "Perl", 1 ] ], - "name" : "Peter Scott", - "id" : "Peter Scott" + "name" : "Peter Scott" }, { + "id" : "Roger Bell West", + "name" : "Roger Bell West", "data" : [ [ "Perl", @@ -54,9 +117,7 @@ "Raku", 2 ] - ], - "name" : "Roger Bell West", - "id" : "Roger Bell West" + ] }, { "name" : "Simon Proctor", @@ -69,82 +130,36 @@ "id" : "Simon Proctor" }, { + "id" : "Wanderdoc", "name" : "Wanderdoc", "data" : [ [ "Perl", 2 ] - ], - "id" : "Wanderdoc" + ] } ] }, - "chart" : { - "type" : "column" + "title" : { + "text" : "Perl Weekly Challenge - 049" + }, + "subtitle" : { + "text" : "[Champions: 7] Last updated at 2020-02-25 11:18:01 GMT" }, - "series" : [ - { - "data" : [ - { - "y" : 4, - "name" : "Luca Ferrari", - "drilldown" : "Luca Ferrari" - }, - { - "y" : 3, - "drilldown" : "Mohammad S Anwar", - "name" : "Mohammad S Anwar" - }, - { - "drilldown" : "Peter Scott", - "name" : "Peter Scott", - "y" : 1 - }, - { - "y" : 4, - "name" : "Roger Bell West", - "drilldown" : "Roger Bell West" - }, - { - "y" : 2, - "drilldown" : "Simon Proctor", - "name" : "Simon Proctor" - }, - { - "name" : "Wanderdoc", - "drilldown" : "Wanderdoc", - "y" : 2 - } - ], - "name" : "Perl Weekly Challenge - 049", - "colorByPoint" : 1 - } - ], "plotOptions" : { "series" : { - "borderWidth" : 0, "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 } }, "legend" : { "enabled" : 0 }, - "subtitle" : { - "text" : "[Champions: 6] Last updated at 2020-02-24 19:01:00 GMT" - }, - "xAxis" : { - "type" : "category" - }, - "title" : { - "text" : "Perl Weekly Challenge - 049" - }, - "tooltip" : { - "followPointer" : 1, - "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", - "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>" + "chart" : { + "type" : "column" } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 00b251d8db..5f2cf7b3e3 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,47 +1,32 @@ { - "yAxis" : { - "min" : 0, - "title" : { - "text" : null - } - }, - "chart" : { - "type" : "column" - }, - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" - }, "title" : { "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" }, - "xAxis" : { - "labels" : { - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - } - }, - "type" : "category" - }, "subtitle" : { - "text" : "Last updated at 2020-02-24 19:01:00 GMT" + "text" : "Last updated at 2020-02-25 11:18:01 GMT" }, "legend" : { "enabled" : "false" }, + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" + }, "series" : [ { "dataLabels" : { "align" : "right", - "rotation" : -90, - "enabled" : "true", + "format" : "{point.y:.0f}", "style" : { "fontSize" : "13px", "fontFamily" : "Verdana, sans-serif" }, "y" : 10, - "format" : "{point.y:.0f}", - "color" : "#FFFFFF" + "color" : "#FFFFFF", + "rotation" : -90, + "enabled" : "true" }, "name" : "Contributions", "data" : [ @@ -51,7 +36,7 @@ ], [ "Perl", - 2008 + 2010 ], [ "Raku", @@ -59,5 +44,20 @@ ] ] } - ] + ], + "xAxis" : { + "type" : "category", + "labels" : { + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + } + } + }, + "yAxis" : { + "min" : 0, + "title" : { + "text" : null + } + } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 68a55d9306..2c36853248 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,14 +1,294 @@ { + "subtitle" : { + "text" : "Click the columns to drilldown the language breakdown. Last updated at 2020-02-25 11:18:01 GMT" + }, + "title" : { + "text" : "Perl Weekly Challenge Language" + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } + }, + "chart" : { + "type" : "column" + }, + "legend" : { + "enabled" : "false" + }, + "tooltip" : { + "followPointer" : "true", + "headerFormat" : "<span style=\"font-size:11px\"></span>", + "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>" + }, + "series" : [ + { + "colorByPoint" : "true", + "data" : [ + { + "name" : "#001", + "y" : 140, + "drilldown" : "001" + }, + { + "drilldown" : "002", + "y" : 109, + "name" : "#002" + }, + { + "name" : "#003", + "y" : 71, + "drilldown" : "003" + }, + { + "drilldown" : "004", + "y" : 91, + "name" : "#004" + }, + { + "drilldown" : "005", + "y" : 71, + "name" : "#005" + }, + { + "name" : "#006", + "y" : 48, + "drilldown" : "006" + }, + { + "name" : "#007", + "y" : 56, + "drilldown" : "007" + }, + { + "drilldown" : "008", + "y" : 70, + "name" : "#008" + }, + { + "drilldown" : "009", + "y" : 68, + "name" : "#009" + }, + { + "name" : "#010", + "y" : 60, + "drilldown" : "010" + }, + { + "y" : 79, + "drilldown" : "011", + "name" : "#011" + }, + { + "y" : 83, + "drilldown" : "012", + "name" : "#012" + }, + { + "drilldown" : "013", + "y" : 76, + "name" : "#013" + }, + { + "name" : "#014", + "drilldown" : "014", + "y" : 96 + }, + { + "name" : "#015", + "y" : 93, + "drilldown" : "015" + }, + { + "name" : "#016", + "y" : 66, + "drilldown" : "016" + }, + { + "name" : "#017", + "y" : 79, + "drilldown" : "017" + }, + { + "name" : "#018", + "y" : 76, + "drilldown" : "018" + }, + { + "y" : 95, + "drilldown" : "019", + "name" : "#019" + }, + { + "drilldown" : "020", + "y" : 95, + "name" : "#020" + }, + { + "name" : "#021", + "y" : 67, + "drilldown" : "021" + }, + { + "name" : "#022", + "y" : 63, + "drilldown" : "022" + }, + { + "name" : "#023", + "drilldown" : "023", + "y" : 91 + }, + { + "name" : "#024", + "y" : 70, + "drilldown" : "024" + }, + { + "name" : "#025", + "y" : 55, + "drilldown" : "025" + }, + { + "drilldown" : "026", + "y" : 70, + "name" : "#026" + }, + { + "name" : "#027", + "y" : 58, + "drilldown" : "027" + }, + { + "name" : "#028", + "drilldown" : "028", + "y" : 78 + }, + { + "y" : 77, + "drilldown" : "029", + "name" : "#029" + }, + { + "name" : "#030", + "y" : 115, + "drilldown" : "030" + }, + { + "name" : "#031", + "drilldown" : "031", + "y" : 87 + }, + { + "name" : "#032", + "y" : 92, + "drilldown" : "032" + }, + { + "drilldown" : "033", + "y" : 108, + "name" : "#033" + }, + { + "drilldown" : "034", + "y" : 60, + "name" : "#034" + }, + { + "name" : "#035", + "drilldown" : "035", + "y" : 60 + }, + { + "name" : "#036", + "y" : 61, + "drilldown" : "036" + }, + { + "name" : "#037", + "drilldown" : "037", + "y" : 63 + }, + { + "name" : "#038", + "drilldown" : "038", + "y" : 60 + }, + { + "name" : "#039", + "drilldown" : "039", + "y" : 60 + }, + { + "name" : "#040", + "drilldown" : "040", + "y" : 66 + }, + { + "drilldown" : "041", + "y" : 69, + "name" : "#041" + }, + { + "name" : "#042", + "drilldown" : "042", + "y" : 88 + }, + { + "name" : "#043", + "y" : 65, + "drilldown" : "043" + }, + { + "name" : "#044", + "y" : 81, + "drilldown" : "044" + }, + { + "drilldown" : "045", + "y" : 94, + "name" : "#045" + }, + { + "y" : 82, + "drilldown" : "046", + "name" : "#046" + }, + { + "y" : 80, + "drilldown" : "047", + "name" : "#047" + }, + { + "name" : "#048", + "drilldown" : "048", + "y" : 101 + }, + { + "name" : "#049", + "y" : 18, + "drilldown" : "049" + } + ], + "name" : "Perl Weekly Challenge Languages" + } + ], "yAxis" : { "title" : { "text" : "Total Solutions" } }, + "xAxis" : { + "type" : "category" + }, "drilldown" : { "series" : [ { - "id" : "001", - "name" : "001", "data" : [ [ "Perl", @@ -22,10 +302,11 @@ "Blog", 11 ] - ] + ], + "name" : "001", + "id" : "001" }, { - "id" : "002", "name" : "002", "data" : [ [ @@ -40,11 +321,10 @@ "Blog", 10 ] - ] + ], + "id" : "002" }, { - "id" : "003", - "name" : "003", "data" : [ [ "Perl", @@ -58,11 +338,11 @@ "Blog", 9 ] - ] + ], + "name" : "003", + "id" : "003" }, { - "id" : "004", - "name" : "004", "data" : [ [ "Perl", @@ -76,10 +356,12 @@ "Blog", 10 ] - ] + ], + "name" : "004", + "id" : "004" }, { - "id" : "005", + "name" : "005", "data" : [ [ "Perl", @@ -94,11 +376,10 @@ 12 ] ], - "name" : "005" + "id" : "005" }, { "id" : "006", - "name" : "006", "data" : [ [ "Perl", @@ -112,10 +393,10 @@ "Blog", 7 ] - ] + ], + "name" : "006" }, { - "id" : "007", "data" : [ [ "Perl", @@ -130,11 +411,10 @@ 10 ] ], - "name" : "007" + "name" : "007", + "id" : "007" }, { - "id" : "008", - "name" : "008", "data" : [ [ "Perl", @@ -148,10 +428,11 @@ "Blog", 12 ] - ] + ], + "name" : "008", + "id" : "008" }, { - "id" : "009", "data" : [ [ "Perl", @@ -166,11 +447,11 @@ 13 ] ], - "name" : "009" + "name" : "009", + "id" : "009" }, { "id" : "010", - "name" : "010", "data" : [ [ "Perl", @@ -184,10 +465,10 @@ "Blog", 11 ] - ] + ], + "name" : "010" }, { - "id" : "011", "name" : "011", "data" : [ [ @@ -202,10 +483,10 @@ "Blog", 10 ] - ] + ], + "id" : "011" }, { - "id" : "012", "data" : [ [ "Perl", @@ -220,7 +501,8 @@ 11 ] ], - "name" : "012" + "name" : "012", + "id" : "012" }, { "data" : [ @@ -241,7 +523,6 @@ "id" : "013" }, { - "id" : "014", "data" : [ [ "Perl", @@ -256,9 +537,12 @@ 15 ] ], - "name" : "014" + "name" : "014", + "id" : "014" }, { + "id" : "015", + "name" : "015", "data" : [ [ "Perl", @@ -272,11 +556,11 @@ "Blog", 15 ] - ], - "name" : "015", - "id" : "015" + ] }, { + "id" : "016", + "name" : "016", "data" : [ [ "Perl", @@ -290,11 +574,10 @@ "Blog", 12 ] - ], - "name" : "016", - "id" : "016" + ] }, { + "id" : "017", "data" : [ [ "Perl", @@ -309,10 +592,10 @@ 12 ] ], - "name" : "017", - "id" : "017" + "name" : "017" }, { + "id" : "018", "name" : "018", "data" : [ [ @@ -327,8 +610,7 @@ "Blog", 14 ] - ], - "id" : "018" + ] }, { "data" : [ @@ -349,6 +631,7 @@ "id" : "019" }, { + "id" : "020", "name" : "020", "data" : [ [ @@ -363,8 +646,7 @@ "Blog", 13 ] - ], - "id" : "020" + ] }, { "id" : "021", @@ -385,7 +667,6 @@ ] }, { - "id" : "022", "name" : "022", "data" : [ [ @@ -400,9 +681,11 @@ "Blog", 10 ] - ] + ], + "id" : "022" }, { + "id" : "023", "name" : "023", "data" : [ [ @@ -417,10 +700,10 @@ "Blog", 12 ] - ], - "id" : "023" + ] }, { + "id" : "024", "data" : [ [ "Perl", @@ -435,11 +718,10 @@ 11 ] ], - "name" : "024", - "id" : "024" + "name" : "024" }, { - "id" : "025", + "name" : "025", "data" : [ [ "Perl", @@ -454,7 +736,7 @@ 12 ] ], - "name" : "025" + "id" : "025" }, { "id" : "026", @@ -494,7 +776,6 @@ }, { "id" : "028", - "name" : "028", "data" : [ [ "Perl", @@ -508,7 +789,8 @@ "Blog", 9 ] - ] + ], + "name" : "028" }, { "name" : "029", @@ -529,6 +811,7 @@ "id" : "029" }, { + "id" : "030", "name" : "030", "data" : [ [ @@ -543,8 +826,7 @@ "Blog", 10 ] - ], - "id" : "030" + ] }, { "id" : "031", @@ -565,7 +847,7 @@ ] }, { - "id" : "032", + "name" : "032", "data" : [ [ "Perl", @@ -580,10 +862,9 @@ 10 ] ], - "name" : "032" + "id" : "032" }, { - "id" : "033", "name" : "033", "data" : [ [ @@ -598,7 +879,8 @@ "Blog", 10 ] - ] + ], + "id" : "033" }, { "id" : "034", @@ -619,8 +901,6 @@ ] }, { - "id" : "035", - "name" : "035", "data" : [ [ "Perl", @@ -634,7 +914,9 @@ "Blog", 9 ] - ] + ], + "name" : "035", + "id" : "035" }, { "id" : "036", @@ -655,7 +937,6 @@ "name" : "036" }, { - "id" : "037", "name" : "037", "data" : [ [ @@ -670,7 +951,8 @@ "Blog", 9 ] - ] + ], + "id" : "037" }, { "id" : "038", @@ -691,6 +973,8 @@ "name" : "038" }, { + "id" : "039", + "name" : "039", "data" : [ [ "Perl", @@ -704,12 +988,10 @@ "Blog", 12 ] - ], - "name" : "039", - "id" : "039" + ] }, { - "id" : "040", + "name" : "040", "data" : [ [ "Perl", @@ -724,10 +1006,9 @@ 9 ] ], - |
