diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2020-02-16 23:49:19 +0000 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2020-02-16 23:49:19 +0000 |
| commit | ec2de2ac1b6b94fc0abeac5ec1294536ef39824f (patch) | |
| tree | 09e7104ab9db8805c5c30ec65c2c6f1bb50cac13 | |
| parent | 7724552a38ed1cdb72993999fc30f9e979e903eb (diff) | |
| download | perlweeklychallenge-club-ec2de2ac1b6b94fc0abeac5ec1294536ef39824f.tar.gz perlweeklychallenge-club-ec2de2ac1b6b94fc0abeac5ec1294536ef39824f.tar.bz2 perlweeklychallenge-club-ec2de2ac1b6b94fc0abeac5ec1294536ef39824f.zip | |
- Added solutions by Colin Crain.
| -rw-r--r-- | challenge-047/colin-crain/perl/ch-2.pl | 41 | ||||
| -rw-r--r-- | challenge-047/colin-crain/raku/ch-2.p6 | 37 | ||||
| -rw-r--r-- | stats/pwc-current.json | 255 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 56 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 380 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 380 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 104 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 60 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 24 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 56 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 122 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 38 |
12 files changed, 825 insertions, 728 deletions
diff --git a/challenge-047/colin-crain/perl/ch-2.pl b/challenge-047/colin-crain/perl/ch-2.pl new file mode 100644 index 0000000000..34b66b58fe --- /dev/null +++ b/challenge-047/colin-crain/perl/ch-2.pl @@ -0,0 +1,41 @@ +#! /opt/local/bin/perl +# +# gapful.pl +# + +# PWC 47 - TASK #2 +# Gapful Number +# Write a script to print first 20 Gapful Numbers greater than or +# equal to 100. # #Please check out the page for more information +# about Gapful Numbers. +# +# A108343 Gapful numbers >= 100: numbers that are +# divisible by the number formed by their first and last +# digit. Numbers up to 100 trivially have this property +# and are excluded. +# +# 100, 105, 108, 110, 120, 121, 130, 132, 135, 140, 143, 150, +# 154, 160, 165, 170, 176, 180, 187, 190, 192, 195, 198, 200, +# 220, 225, 231, 240, 242, 253, 260, 264, 275, 280, 286, 297, +# 300, 315, 330, 341, 352, 360, 363, 374, 385, 390, 396, 400, +# 405, 440, 451 +# +# 2020 colin crain +## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## + + + +use warnings; +use strict; +use feature ":5.26"; + +## ## ## ## ## MAIN + +my $testval = 99; +my @output; + +while (scalar @output < 20 && $testval++ ) { + my $gap = substr( $testval, 0, 1 ) . substr( $testval, -1, 1 ); + push @output, $testval if $testval % $gap == 0; +} +say for @output; diff --git a/challenge-047/colin-crain/raku/ch-2.p6 b/challenge-047/colin-crain/raku/ch-2.p6 new file mode 100644 index 0000000000..f0c6a0f75b --- /dev/null +++ b/challenge-047/colin-crain/raku/ch-2.p6 @@ -0,0 +1,37 @@ +use v6.d; + +# +# gapful.raku +# +# PWC 47 - TASK #2 +# Gapful Number +# Write a script to print first 20 Gapful Numbers greater than or +# equal to 100. # #Please check out the page for more information +# about Gapful Numbers. +# +# A108343 Gapful numbers >= 100: numbers that are +# divisible by the number formed by their first and last +# digit. Numbers up to 100 trivially have this property +# and are excluded. +# +# 100, 105, 108, 110, 120, 121, 130, 132, 135, 140, 143, 150, +# 154, 160, 165, 170, 176, 180, 187, 190, 192, 195, 198, 200, +# 220, 225, 231, 240, 242, 253, 260, 264, 275, 280, 286, 297, +# 300, 315, 330, 341, 352, 360, 363, 374, 385, 390, 396, 400, +# 405, 440, 451 +# +# 2020 colin crain +## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## + +sub MAIN () { + + ## this parses to literally exactly the definition of A108343 above; allow + ## only numbers (starting at 100) "that are divisible by the number formed by + ## their first and last digit"". + + my @o2 = (100..*).grep({ $_ %% (.comb.head ~ .comb.tail) }); + + ## output creates the first required 20 elements of the lazy list + say @o2[$_] for (0..19); + +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index ea68f8797b..a3c8531944 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,12 +1,4 @@ { - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "xAxis" : { - "type" : "category" - }, "series" : [ { "colorByPoint" : 1, @@ -14,23 +6,23 @@ "data" : [ { "drilldown" : "Alicia Bielsa", - "name" : "Alicia Bielsa", - "y" : 3 + "y" : 3, + "name" : "Alicia Bielsa" }, { - "drilldown" : "Andrezgz", + "name" : "Andrezgz", "y" : 2, - "name" : "Andrezgz" + "drilldown" : "Andrezgz" }, { - "drilldown" : "Arne Sommer", + "name" : "Arne Sommer", "y" : 3, - "name" : "Arne Sommer" + "drilldown" : "Arne Sommer" }, { "drilldown" : "Athanasius", - "y" : 3, - "name" : "Athanasius" + "name" : "Athanasius", + "y" : 3 }, { "drilldown" : "Cheok-Yin Fung", @@ -38,14 +30,19 @@ "name" : "Cheok-Yin Fung" }, { + "drilldown" : "Colin Crain", + "name" : "Colin Crain", + "y" : 2 + }, + { "drilldown" : "Cristina Heredia", "name" : "Cristina Heredia", "y" : 1 }, { + "drilldown" : "Dave Cross", "y" : 2, - "name" : "Dave Cross", - "drilldown" : "Dave Cross" + "name" : "Dave Cross" }, { "drilldown" : "Dave Jacoby", @@ -58,9 +55,9 @@ "drilldown" : "Duane Powell" }, { - "y" : 2, + "drilldown" : "Duncan C. White", "name" : "Duncan C. White", - "drilldown" : "Duncan C. White" + "y" : 2 }, { "drilldown" : "E. Choroba", @@ -69,28 +66,28 @@ }, { "drilldown" : "Javier Luque", - "name" : "Javier Luque", - "y" : 5 + "y" : 5, + "name" : "Javier Luque" }, { - "drilldown" : "Kevin Colyer", + "name" : "Kevin Colyer", "y" : 2, - "name" : "Kevin Colyer" + "drilldown" : "Kevin Colyer" }, { - "drilldown" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", "y" : 5, - "name" : "Laurent Rosenfeld" + "drilldown" : "Laurent Rosenfeld" }, { - "y" : 2, + "drilldown" : "Lubos Kolouch", "name" : "Lubos Kolouch", - "drilldown" : "Lubos Kolouch" + "y" : 2 }, { - "name" : "Luca Ferrari", + "drilldown" : "Luca Ferrari", "y" : 4, - "drilldown" : "Luca Ferrari" + "name" : "Luca Ferrari" }, { "y" : 2, @@ -98,9 +95,9 @@ "drilldown" : "Mark Anderson" }, { - "name" : "Markus Holzer", + "drilldown" : "Markus Holzer", "y" : 2, - "drilldown" : "Markus Holzer" + "name" : "Markus Holzer" }, { "name" : "Mohammad S Anwar", @@ -109,23 +106,23 @@ }, { "drilldown" : "Noud Aldenhoven", - "y" : 2, - "name" : "Noud Aldenhoven" + "name" : "Noud Aldenhoven", + "y" : 2 }, { "drilldown" : "Phillip Harris", - "name" : "Phillip Harris", - "y" : 2 + "y" : 2, + "name" : "Phillip Harris" }, { - "drilldown" : "Ruben Westerberg", + "name" : "Ruben Westerberg", "y" : 4, - "name" : "Ruben Westerberg" + "drilldown" : "Ruben Westerberg" }, { - "y" : 2, + "drilldown" : "Saif Ahmed", "name" : "Saif Ahmed", - "drilldown" : "Saif Ahmed" + "y" : 2 }, { "y" : 2, @@ -133,19 +130,19 @@ "drilldown" : "Simon Proctor" }, { - "drilldown" : "Steven Wilson", "name" : "Steven Wilson", - "y" : 1 + "y" : 1, + "drilldown" : "Steven Wilson" }, { - "drilldown" : "Ulrich Rieke", + "name" : "Ulrich Rieke", "y" : 3, - "name" : "Ulrich Rieke" + "drilldown" : "Ulrich Rieke" }, { - "drilldown" : "User Person", + "name" : "User Person", "y" : 2, - "name" : "User Person" + "drilldown" : "User Person" }, { "y" : 2, @@ -155,37 +152,14 @@ ] } ], - "tooltip" : { - "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", - "followPointer" : 1, - "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>" - }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 + "yAxis" : { + "title" : { + "text" : "Total Solutions" } }, - "subtitle" : { - "text" : "[Champions: 28] Last updated at 2020-02-16 23:37:27 GMT" - }, - "title" : { - "text" : "Perl Weekly Challenge - 047" - }, - "chart" : { - "type" : "column" - }, - "legend" : { - "enabled" : 0 - }, "drilldown" : { "series" : [ { - "name" : "Alicia Bielsa", - "id" : "Alicia Bielsa", "data" : [ [ "Perl", @@ -195,19 +169,22 @@ "Raku", 1 ] - ] + ], + "id" : "Alicia Bielsa", + "name" : "Alicia Bielsa" }, { + "name" : "Andrezgz", "data" : [ [ "Perl", 2 ] ], - "name" : "Andrezgz", "id" : "Andrezgz" }, { + "id" : "Arne Sommer", "data" : [ [ "Raku", @@ -218,7 +195,6 @@ 1 ] ], - "id" : "Arne Sommer", "name" : "Arne Sommer" }, { @@ -232,8 +208,8 @@ 1 ] ], - "name" : "Athanasius", - "id" : "Athanasius" + "id" : "Athanasius", + "name" : "Athanasius" }, { "name" : "Cheok-Yin Fung", @@ -246,13 +222,27 @@ ] }, { + "name" : "Colin Crain", + "id" : "Colin Crain", "data" : [ [ "Perl", 1 + ], + [ + "Raku", + 1 ] - ], + ] + }, + { "id" : "Cristina Heredia", + "data" : [ + [ + "Perl", + 1 + ] + ], "name" : "Cristina Heredia" }, { @@ -276,40 +266,41 @@ 1 ] ], - "name" : "Dave Jacoby", - "id" : "Dave Jacoby" + "id" : "Dave Jacoby", + "name" : "Dave Jacoby" }, { - "id" : "Duane Powell", "name" : "Duane Powell", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Duane Powell" }, { + "name" : "Duncan C. White", + "id" : "Duncan C. White", "data" : [ [ "Perl", 2 ] - ], - "id" : "Duncan C. White", - "name" : "Duncan C. White" + ] }, { + "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] ], - "id" : "E. Choroba", "name" : "E. Choroba" }, { + "id" : "Javier Luque", "data" : [ [ "Perl", @@ -324,22 +315,19 @@ 1 ] ], - "id" : "Javier Luque", "name" : "Javier Luque" }, { "name" : "Kevin Colyer", - "id" : "Kevin Colyer", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Kevin Colyer" }, { - "id" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -353,19 +341,23 @@ "Blog", 1 ] - ] + ], + "id" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld" }, { "id" : "Lubos Kolouch", - "name" : "Lubos Kolouch", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Lubos Kolouch" }, { + "name" : "Luca Ferrari", + "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -375,33 +367,31 @@ "Blog", 2 ] - ], - "name" : "Luca Ferrari", - "id" : "Luca Ferrari" + ] }, { "name" : "Mark Anderson", - "id" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Mark Anderson" }, { - "id" : "Markus Holzer", "name" : "Markus Holzer", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Markus Holzer" }, { - "id" : "Mohammad S Anwar", "name" : "Mohammad S Anwar", + "id" : "Mohammad S Anwar", "data" : [ [ "Perl", @@ -410,26 +400,27 @@ ] }, { + "name" : "Noud Aldenhoven", "data" : [ [ "Raku", 2 ] ], - "name" : "Noud Aldenhoven", "id" : "Noud Aldenhoven" }, { "id" : "Phillip Harris", - "name" : "Phillip Harris", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Phillip Harris" }, { + "name" : "Ruben Westerberg", "data" : [ [ "Perl", @@ -440,42 +431,39 @@ 2 ] ], - "name" : "Ruben Westerberg", "id" : "Ruben Westerberg" }, { "id" : "Saif Ahmed", - "name" : "Saif Ahmed", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Saif Ahmed" }, { - "name" : "Simon Proctor", "id" : "Simon Proctor", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "Simon Proctor" }, { + "id" : "Steven Wilson", "data" : [ [ "Perl", 1 ] ], - "id" : "Steven Wilson", "name" : "Steven Wilson" }, { - "name" : "Ulrich Rieke", - "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -485,28 +473,59 @@ "Raku", 2 ] - ] + ], + "id" : "Ulrich Rieke", + "name" : "Ulrich Rieke" }, { + "name" : "User Person", "data" : [ [ "Perl", 2 ] ], - "name" : "User Person", "id" : "User Person" }, { + "name" : "Wanderdoc", + "id" : "Wanderdoc", "data" : [ [ "Perl", 2 ] - ], - "name" : "Wanderdoc", - "id" : "Wanderdoc" + ] } ] + }, + "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 + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, + "chart" : { + "type" : "column" + }, + "title" : { + "text" : "Perl Weekly Challenge - 047" + }, + "subtitle" : { + "text" : "[Champions: 29] Last updated at 2020-02-16 23:48:41 GMT" + }, + "legend" : { + "enabled" : 0 + }, + "xAxis" : { + "type" : "category" } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 3b19cdef4d..56e2d83528 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,43 +1,49 @@ { - "chart" : { - "type" : "column" + "xAxis" : { + "type" : "category", + "labels" : { + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + } + } }, "legend" : { "enabled" : "false" }, - "subtitle" : { - "text" : "Last updated at 2020-02-16 23:37:27 GMT" - }, "title" : { "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" }, + "subtitle" : { + "text" : "Last updated at 2020-02-16 23:48:41 GMT" + }, + "chart" : { + "type" : "column" + }, "tooltip" : { "pointFormat" : "<b>{point.y:.0f}</b>" }, - "xAxis" : { - "labels" : { - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - } + "yAxis" : { + "title" : { + "text" : null }, - "type" : "category" + "min" : 0 }, "series" : [ { + "name" : "Contributions", "dataLabels" : { + "y" : 10, + "enabled" : "true", + "format" : "{point.y:.0f}", + "color" : "#FFFFFF", "align" : "right", + "rotation" : -90, "style" : { "fontFamily" : "Verdana, sans-serif", "fontSize" : "13px" - }, - "format" : "{point.y:.0f}", - "y" : 10, - "color" : "#FFFFFF", - "rotation" : -90, - "enabled" : "true" + } }, - "name" : "Contributions", "data" : [ [ "Blog", @@ -45,19 +51,13 @@ ], [ "Perl", - 1941 + 1942 ], [ "Raku", - 1186 + 1187 ] ] } - ], - "yAxis" : { - "title" : { - "text" : null - }, - "min" : 0 - } + ] } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 1b420d84ab..026c80e652 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,33 +1,8 @@ { - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } - } - }, - "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/>" - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2020-02-16 23:37:27 GMT" - }, - "title" : { - "text" : "Perl Weekly Challenge Language" - }, - "chart" : { - "type" : "column" - }, - "legend" : { - "enabled" : "false" - }, "drilldown" : { "series" : [ { + "id" : "001", "data" : [ [ "Perl", @@ -42,10 +17,10 @@ 11 ] ], - "name" : "001", - "id" : "001" + "name" : "001" }, { + "id" : "002", "data" : [ [ "Perl", @@ -60,11 +35,9 @@ 10 ] ], - "id" : "002", "name" : "002" }, { - "id" : "003", "name" : "003", "data" : [ [ @@ -79,9 +52,11 @@ "Blog", 9 ] - ] + ], + "id" : "003" }, { + "name" : "004", "data" : [ [ "Perl", @@ -96,10 +71,11 @@ 10 ] ], - "id" : "004", - "name" : "004" + "id" : "004" }, { + "name" : "005", + "id" : "005", "data" : [ [ "Perl", @@ -113,13 +89,9 @@ "Blog", 12 ] - ], - "name" : "005", - "id" : "005" + ] }, { - "name" : "006", - "id" : "006", "data" : [ [ "Perl", @@ -133,9 +105,12 @@ "Blog", 7 ] - ] + ], + "id" : "006", + "name" : "006" }, { + "name" : "007", "data" : [ [ "Perl", @@ -150,10 +125,10 @@ 10 ] ], - "id" : "007", - "name" : "007" + "id" : "007" }, { + "name" : "008", "data" : [ [ "Perl", @@ -168,10 +143,10 @@ 12 ] ], - "id" : "008", - "name" : "008" + "id" : "008" }, { + "id" : "009", "data" : [ [ "Perl", @@ -186,8 +161,7 @@ 13 ] ], - "name" : "009", - "id" : "009" + "name" : "009" }, { "name" : "010", @@ -208,6 +182,8 @@ ] }, { + "name" : "011", + "id" : "011", "data" : [ [ "Perl", @@ -221,13 +197,9 @@ "Blog", 10 ] - ], - "name" : "011", - "id" : "011" + ] }, { - "id" : "012", - "name" : "012", "data" : [ [ "Perl", @@ -241,7 +213,9 @@ "Blog", 11 ] - ] + ], + "id" : "012", + "name" : "012" }, { "name" : "013", @@ -280,6 +254,7 @@ "name" : "014" }, { + "name" : "015", "data" : [ [ "Perl", @@ -294,12 +269,10 @@ 15 ] ], - "id" : "015", - "name" : "015" + "id" : "015" }, { "name" : "016", - "id" : "016", "data" : [ [ "Perl", @@ -313,9 +286,12 @@ "Blog", 12 ] - ] + ], + "id" : "016" }, { + "name" : "017", + "id" : "017", "data" : [ [ "Perl", @@ -329,11 +305,11 @@ "Blog", 12 ] - ], - "name" : "017", - "id" : "017" + ] }, { + "name" : "018", + "id" : "018", "data" : [ [ "Perl", @@ -347,13 +323,9 @@ "Blog", 14 ] - ], - "id" : "018", - "name" : "018" + ] }, { - "id" : "019", - "name" : "019", "data" : [ [ "Perl", @@ -367,7 +339,9 @@ "Blog", 13 ] - ] + ], + "id" : "019", + "name" : "019" }, { "data" : [ @@ -388,6 +362,8 @@ "name" : "020" }, { + "name" : "021", + "id" : "021", "data" : [ [ "Perl", @@ -401,11 +377,11 @@ "Blog", 10 ] - ], - "id" : "021", - "name" : "021" + ] }, { + "name" : "022", + "id" : "022", "data" : [ [ "Perl", @@ -419,13 +395,10 @@ "Blog", 10 ] - ], - "name" : "022", - "id" : "022" + ] }, { "name" : "023", - "id" : "023", "data" : [ [ "Perl", @@ -439,11 +412,10 @@ "Blog", 12 ] - ] + ], + "id" : "023" }, { - "id" : "024", - "name" : "024", "data" : [ [ "Perl", @@ -457,9 +429,13 @@ "Blog", 11 ] - ] + ], + "id" : "024", + "name" : "024" }, { + "name" : "025", + "id" : "025", "data" : [ [ "Perl", @@ -473,13 +449,11 @@ "Blog", 12 ] - ], - "id" : "025", - "name" : "025" + ] }, {< |
