diff options
| -rwxr-xr-x | challenge-139/pete-houston/perl/ch-1.pl | 25 | ||||
| -rwxr-xr-x | challenge-139/pete-houston/perl/ch-2.pl | 54 | ||||
| -rw-r--r-- | stats/pwc-current.json | 293 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 48 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 1960 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 390 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 42 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 122 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 116 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 46 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 46 | ||||
| -rw-r--r-- | stats/pwc-summary-241-270.json | 32 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 48 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 106 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 106 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 542 |
16 files changed, 2035 insertions, 1941 deletions
diff --git a/challenge-139/pete-houston/perl/ch-1.pl b/challenge-139/pete-houston/perl/ch-1.pl new file mode 100755 index 0000000000..6f370abdd0 --- /dev/null +++ b/challenge-139/pete-houston/perl/ch-1.pl @@ -0,0 +1,25 @@ +#!/usr/bin/env perl +#=============================================================================== +# +# FILE: 13901.pl +# +# USAGE: ./13901.pl N N [ N ... ] +# +# DESCRIPTION: Outputs 1 if the argumentss are numerically sorted ascending, +# 0 otherwise. +# +# REQUIREMENTS: List::MoreUtils 0.430 for slide +# NOTES: Assumes arguments are numbers +# AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk +# ORGANIZATION: Openstrike +# VERSION: 1.0 +# CREATED: 15/11/21 +#=============================================================================== + +use strict; +use warnings; +use List::MoreUtils 0.430 qw/slide all/; + +my $sorted = 0; +$sorted = 1 if @ARGV < 2 || all { $_ } slide { $a <= $b } @ARGV; +print "$sorted\n"; diff --git a/challenge-139/pete-houston/perl/ch-2.pl b/challenge-139/pete-houston/perl/ch-2.pl new file mode 100755 index 0000000000..02fbe9b1bf --- /dev/null +++ b/challenge-139/pete-houston/perl/ch-2.pl @@ -0,0 +1,54 @@ +#!/usr/bin/env perl +#=============================================================================== +# +# FILE: 13902.pl +# +# USAGE: ./13902.pl +# +# DESCRIPTION: Output the first 5 long primes +# +# REQUIREMENTS: bignum, Math::Prime::Util +# NOTES: This produces results consistent with the definition +# given in the task viz: +# +# A prime number (p) is called Long Prime if (1/p) has +# an infinite decimal expansion repeating every (p-1) +# digits. +# +# eg. 3 is considered a long prime because the sequence '33' +# is repeated ad infinitum. +# This appears to differ from the generally accepted Number +# Theory definition which suggests that this sequence must +# not internally repeat. +# AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk +# ORGANIZATION: Openstrike +# VERSION: 1.0 +# CREATED: 15/11/21 +#=============================================================================== + +use strict; +use warnings; + +use bignum; +use Math::Prime::Util 'next_prime'; + +my $i = 1; +my @longs; + +while (5 > @longs) { + $i = next_prime ($i); + push @longs, $i if is_long ($i); +} + +print "First 5 long primes are: @longs\n"; + +sub is_long { + my $p = shift; + my $rlen = $p - 1; # Length of repeating pattern + + my $q = 1 / $p; + $q =~ s/^[0.]+//; + return if 2 * $rlen > length $q; + my $pat = substr ($q, 0, $rlen); + return substr ($q, $rlen, $rlen) eq $pat; +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 95b865c350..1f9d91740b 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,28 +1,23 @@ { - "subtitle" : { - "text" : "[Champions: 28] Last updated at 2021-11-21 19:39:28 GMT" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "title" : { - "text" : "The Weekly Challenge - 139" + "legend" : { + "enabled" : 0 }, - "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/>" + "chart" : { + "type" : "column" }, - "xAxis" : { - "type" : "category" + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } }, "drilldown" : { "series" : [ { "id" : "Abigail", - "name" : "Abigail", "data" : [ [ "Perl", @@ -32,7 +27,8 @@ "Blog", 2 ] - ] + ], + "name" : "Abigail" }, { "data" : [ @@ -41,12 +37,11 @@ 1 ] ], - "name" : "Andrew Shitov", - "id" : "Andrew Shitov" + "id" : "Andrew Shitov", + "name" : "Andrew Shitov" }, { "id" : "Athanasius", - "name" : "Athanasius", "data" : [ [ "Perl", @@ -56,29 +51,31 @@ "Raku", 2 ] - ] + ], + "name" : "Athanasius" }, { + "name" : "Cheok-Yin Fung", + "id" : "Cheok-Yin Fung", "data" : [ [ "Perl", 2 ] - ], - "name" : "Cheok-Yin Fung", - "id" : "Cheok-Yin Fung" + ] }, { - "id" : "Cristina Heredia", - "name" : "Cristina Heredia", "data" : [ [ "Perl", 1 ] - ] + ], + "id" : "Cristina Heredia", + "name" : "Cristina Heredia" }, { + "name" : "Dave Jacoby", "data" : [ [ "Perl", @@ -89,21 +86,19 @@ 1 ] ], - "name" : "Dave Jacoby", "id" : "Dave Jacoby" }, { + "name" : "E. Choroba", + "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ], - "id" : "E. Choroba", - "name" : "E. Choroba" + ] }, { - "id" : "Flavio Poletti", "name" : "Flavio Poletti", "data" : [ [ @@ -118,21 +113,20 @@ "Blog", 2 ] - ] + ], + "id" : "Flavio Poletti" }, { - "name" : "Jake", - "id" : "Jake", "data" : [ [ "Perl", 1 ] - ] + ], + "id" : "Jake", + "name" : "Jake" }, { - "name" : "Jaldhar H. Vyas", - "id" : "Jaldhar H. Vyas", "data" : [ [ "Perl", @@ -146,9 +140,12 @@ "Blog", 1 ] - ] + ], + "id" : "Jaldhar H. Vyas", + "name" : "Jaldhar H. Vyas" }, { + "name" : "James Smith", "data" : [ [ "Perl", @@ -159,30 +156,30 @@ 1 ] ], - "name" : "James Smith", "id" : "James Smith" }, { - "id" : "Jan Krnavek", "name" : "Jan Krnavek", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Jan Krnavek" }, { + "name" : "Jorg Sommrey", "data" : [ [ "Perl", 2 ] ], - "id" : "Jorg Sommrey", - "name" : "Jorg Sommrey" + "id" : "Jorg Sommrey" }, { + "id" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -197,22 +194,20 @@ 1 ] ], - "name" : "Laurent Rosenfeld", - "id" : "Laurent Rosenfeld" + "name" : "Laurent Rosenfeld" }, { - "name" : "Lubos Kolouch", "id" : "Lubos Kolouch", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Lubos Kolouch" }, { "name" : "Luca Ferrari", - "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -222,21 +217,20 @@ "Blog", 4 ] - ] + ], + "id" : "Luca Ferrari" }, { + "name" : "Mark Anderson", + "id" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ], - "id" : "Mark Anderson", - "name" : "Mark Anderson" + ] }, { - "id" : "Mohammad S Anwar", - "name" : "Mohammad S Anwar", "data" : [ [ "Perl", @@ -246,61 +240,71 @@ "Raku", 1 ] - ] + ], + "id" : "Mohammad S Anwar", + "name" : "Mohammad S Anwar" }, { - "name" : "Niels van Dijke", "id" : "Niels van Dijke", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Niels van Dijke" }, { "id" : "Olivier Delouya", - "name" : "Olivier Delouya", "data" : [ [ "Perl", 1 ] - ] + ], + "name" : "Olivier Delouya" + }, + { + "id" : "Paulo Custodio", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Paulo Custodio" }, { + "id" : "Pete Houston", "data" : [ [ "Perl", 2 ] ], - "name" : "Paulo Custodio", - "id" : "Paulo Custodio" + "name" : "Pete Houston" }, { - "name" : "Peter Campbell Smith", "id" : "Peter Campbell Smith", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Peter Campbell Smith" }, { "name" : "Robert DiCicco", - "id" : "Robert DiCicco", "data" : [ [ "Perl", 1 ] - ] + ], + "id" : "Robert DiCicco" }, { - "name" : "Roger Bell_West", - "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -314,11 +318,11 @@ "Blog", 1 ] - ] + ], + "id" : "Roger Bell_West", + "name" : "Roger Bell_West" }, { - "name" : "Simon Green", - "id" : "Simon Green", "data" : [ [ "Perl", @@ -328,19 +332,23 @@ "Blog", 1 ] - ] + ], + "id" : "Simon Green", + "name" : "Simon Green" }, { "name" : "Steven Wilson", - "id" : "Steven Wilson", "data" : [ [ "Perl", 1 ] - ] + ], + "id" : "Steven Wilson" }, { + "name" : "Ulrich Rieke", + "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -350,11 +358,10 @@ "Raku", 2 ] - ], - "name" : "Ulrich Rieke", - "id" : "Ulrich Rieke" + ] }, { + "id" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -365,38 +372,47 @@ 1 ] ], - "name" : "W. Luis Mochan", - "id" : "W. Luis Mochan" + "name" : "W. Luis Mochan" } ] }, + "subtitle" : { + "text" : "[Champions: 29] Last updated at 2021-11-21 19:53:00 GMT" + }, + "tooltip" : { + "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/>", + "followPointer" : 1 + }, "series" : [ { + "name" : "The Weekly Challenge - 139", + "colorByPoint" : 1, "data" : [ { - "name" : "Abigail", "drilldown" : "Abigail", - "y" : 4 + "y" : 4, + "name" : "Abigail" }, { - "y" : 1, + "name" : "Andrew Shitov", "drilldown" : "Andrew Shitov", - "name" : "Andrew Shitov" + "y" : 1 }, { - "name" : "Athanasius", "drilldown" : "Athanasius", - "y" : 4 + "y" : 4, + "name" : "Athanasius" }, { - "drilldown" : "Cheok-Yin Fung", + "name" : "Cheok-Yin Fung", "y" : 2, - "name" : "Cheok-Yin Fung" + "drilldown" : "Cheok-Yin Fung" }, { - "name" : "Cristina Heredia", + "y" : 1, "drilldown" : "Cristina Heredia", - "y" : 1 + "name" : "Cristina Heredia" }, { "drilldown" : "Dave Jacoby", @@ -404,14 +420,14 @@ "name" : "Dave Jacoby" }, { + "name" : "E. Choroba", "drilldown" : "E. Choroba", - "y" : 2, - "name" : "E. Choroba" + "y" : 2 }, { "name" : "Flavio Poletti", - "drilldown" : "Flavio Poletti", - "y" : 6 + "y" : 6, + "drilldown" : "Flavio Poletti" }, { "y" : 1, @@ -424,14 +440,14 @@ "drilldown" : "Jaldhar H. Vyas" }, { - "drilldown" : "James Smith", + "name" : "James Smith", "y" : 3, - "name" : "James Smith" + "drilldown" : "James Smith" }, { - "name" : "Jan Krnavek", "y" : 2, - "drilldown" : "Jan Krnavek" + "drilldown" : "Jan Krnavek", + "name" : "Jan Krnavek" }, { "name" : "Jorg Sommrey", @@ -440,23 +456,23 @@ }, { "name" : "Laurent Rosenfeld", - "y" : 5, - "drilldown" : "Laurent Rosenfeld" + "drilldown" : "Laurent Rosenfeld", + "y" : 5 }, { - "y" : 2, "drilldown" : "Lubos Kolouch", + "y" : 2, "name" : "Lubos Kolouch" }, { + "name" : "Luca Ferrari", "y" : 6, - "drilldown" : "Luca Ferrari", - "name" : "Luca Ferrari" + "drilldown" : "Luca Ferrari" }, { + "name" : "Mark Anderson", "drilldown" : "Mark Anderson", - "y" : 2, - "name" : "Mark Anderson" + "y" : 2 }, { "name" : "Mohammad S Anwar", @@ -465,72 +481,71 @@ }, { "name" : "Niels van Dijke", - "drilldown" : "Niels van Dijke", - "y" : 2 + "y" : 2, + "drilldown" : "Niels van Dijke" }, { "name" : "Olivier Delouya", - "y" : 1, - "drilldown" : "Olivier Delouya" + "drilldown" : "Olivier Delouya", + "y" : 1 }, { "name" : "Paulo Custodio", + "drilldown" : "Paulo Custodio", + "y" : 2 + }, + { + "name" : "Pete Houston", "y" : 2, - "drilldown" : "Paulo Custodio" + "drilldown" : "Pete Houston" }, { + "name" : "Peter Campbell Smith", "y" : 2, - "drilldown" : "Peter Campbell Smith", - "name" : "Peter Campbell Smith" + "drilldown" : "Peter Campbell Smith" }, { - "drilldown" : "Robert DiCicco", + "name" : "Robert DiCicco", "y" : 1, - "name" : "Robert DiCicco" + "drilldown" : "Robert DiCicco" }, { + "name" : "Roger Bell_West", "drilldown" : "Roger Bell_West", - "y" : 5, - "name" : "Roger Bell_West" + "y" : 5 }, { + "name" : "Simon Green", "y" : 3, - "drilldown" : "Simon Green", - "name" : "Simon Green" + "drilldown" : "Simon Green" }, { - "drilldown" : "Steven Wilson", + "name" : "Steven Wilson", "y" : 1, - "name" : "Steven Wilson" + "drilldown" : "Steven Wilson" }, { + "name" : "Ulrich Rieke", "y" : 4, - "drilldown" : "Ulrich Rieke", - "name" : "Ulrich Rieke" + "drilldown" : "Ulrich Rieke" }, { - "name" : "W. Luis Mochan", + "drilldown" : "W. Luis Mochan", "y" : 3, - "drilldown" : "W. Luis Mochan" + "name" : "W. Luis Mochan" } - ], - "name" : "The Weekly Challenge - 139", - "colorByPoint" : 1 + ] } ], - "legend" : { - "enabled" : 0 + "title" : { + "text" : "The Weekly Challenge - 139" }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - }, - "borderWidth" : 0 - } + "xAxis" : { + "type" : "category" }, - "chart" : { - "type" : "column" + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 4db302ca0c..5b49fbdacf 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,21 +1,9 @@ { - "chart" : { - "type" : "column" - }, - "legend" : { - "enabled" : "false" - }, - "subtitle" : { - "text" : "Last updated at 2021-11-21 19:39:28 GMT" - }, "yAxis" : { - "min" : 0, "title" : { "text" : null - } - }, - "title" : { - "text" : "The Weekly Challenge Contributions [2019 - 2021]" + }, + "min" : 0 }, "xAxis" : { "type" : "category", @@ -26,6 +14,12 @@ } } }, + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" + }, + "subtitle" : { + "text" : "Last updated at 2021-11-21 19:53:00 GMT" + }, "series" : [ { "data" : [ @@ -35,7 +29,7 @@ ], [ "Perl", - 6685 + 6687 ], [ "Raku", @@ -43,21 +37,27 @@ ] ], "dataLabels" : { - "rotation" : -90, "format" : "{point.y:.0f}", - "align" : "right", + "rotation" : -90, "y" : 10, - "color" : "#FFFFFF", - "enabled" : "true", "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - } + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + }, + "align" : "right", + "color" : "#FFFFFF", + "enabled" : "true" }, "name" : "Contributions" } ], - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" + "chart" : { + "type" : "column" + }, + "title" : { + "text" : "The Weekly Challenge Contributions [2019 - 2021]" + }, + "legend" : { + "enabled" : "false" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 721ec66cc2..9cc07ed8ab 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,19 +1,717 @@ { - "title" : { - "text" : "The Weekly Challenge Language" - }, "yAxis" : { "title" : { "text" : "Total Solutions" } }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2021-11-21 19:39:28 GMT" + "xAxis" : { + "type" : "category" }, - "tooltip" : { - "headerFormat" : "<span style=\"font-size:11px\"></span>", - "followPointer" : "true", - "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>" + "series" : [ + { + "data" : [ + { + "drilldown" : "001", + "y" : 161, + "name" : "#001" + }, + { + "name" : "#002", + "drilldown" : "002", + "y" : 125 + }, + { + "y" : 83, + "drilldown" : "003", + "name" : "#003" + }, + { + "name" : "#004", + "y" : 99, + "drilldown" : "004" + }, + { + "y" : 78, + "drilldown" : "005", + "name" : "#005" + }, + { + "name" : "#006", + "drilldown" : "006", + "y" : 58 + }, + { + "drilldown" : "007", + "y" : 64, + "name" : "#007" + }, + { + "name" : "#008", + "y" : 78, + "drilldown" : "008" + }, + { + "drilldown" : "009", + "y" : 76, + "name" : "#009" + }, + { + "y" : 65, + "drilldown" : "010", + "name" : "#010" + }, + { + "drilldown" : "011", + "y" : 85, + "name" : "#011" + }, + { + "name" : "#012", + "y" : 89, + "drilldown" : "012" + }, + { + "drilldown" : "013", + "y" : 85, + "name" : "#013" + }, + { + "drilldown" : "014", + "y" : 101, + "name" : "#014" + }, + { + "name" : "#015", + "drilldown" : "015", + "y" : 99 + }, + { + "drilldown" : "016", + "y" : 71, + "name" : "#016" + }, + { + "name" : "#017", + "drilldown" : "017", + "y" : 84 + }, + { + "name" : "#018", + "y" : 81, + "drilldown" : "018" + }, + { + "drilldown" : "019", + "y" : 103, + "name" : "#019" + }, + { + "drilldown" : "020", + "y" : 101, + "name" : "#020" + }, + { + "name" : "#021", + "drilldown" : "021", + "y" : 72 + }, + { + "y" : 68, + "drilldown" : "022", + "name" : "#022" + }, + { + "drilldown" : "023", + "y" : 97, + "name" : "#023" + }, + { + "drilldown" : "024", + "y" : 75, + "name" : "#024" + }, + { + "drilldown" : "025", + "y" : 59, + "name" : "#025" + }, + { + "drilldown" : "026", + "y" : 74, + "name" : "#026" + }, + { + "y" : 60, + "drilldown" : "027", + "name" : "#027" + }, + { + "y" : 80, + "drilldown" : "028", + "name" : "#028" + }, + { + "name" : "#029", + "drilldown" : "029", + "y" : 79 + }, + { + "y" : 117, + "drilldown" : "030", + "name" : "#030" + }, + { + "name" : "#031", + "y" : 89, + "drilldown" : "031" + }, + { + "name" : "#032", + "y" : 94, + "drilldown" : "032" + }, + { + "y" : 110, + "drilldown" : "033", + "name" : "#033" + }, + { + "name" : "#034", + "y" : 64, + "drilldown" : "034" + }, + { + "drilldown" : "035", + "y" : 64, + "name" : "#035" + }, + { + "name" : "#036", + "y" : 68, + "drilldown" : "036" + }, + { + "y" : 67, + "drilldown" : "037", + "name" : "#037" + }, + { + "name" : "#038", + "drilldown" : "038", + "y" : 68 + }, + { + "name" : "#039", + "drilldown" : "039", + "y" : 62 + }, + { + "drilldown" : "040", + "y" : 73, + "name" : "#040" + }, + { + "name" : "#041", + "drilldown" : "041", + "y" : 76 + }, + { + "y" : 92, + "drilldown" : "042", + "name" : "#042" + }, + { + "y" : 68, + "drilldown" : "043", + "name" : "#043" + }, + { + "name" : "#044", + "drilldown" : "044", + "y" : 85 + }, + { + "drilldown" : "045", + "y" : 96, + "name" : "#045" + }, + { + "y" : 87, + "drilldown" : "046", + "name" : "#046" + }, + { + "drilldown" : "047", + "y" : 84, + "name" : "#047" + }, + { + "name" : "#048", + "y" : 108, + "drilldown" : "048" + }, + { + "y" : 89, + "drilldown" : "049", + "name" : "#049" + }, + { + "name" : "#050", + "y" : 98, + "drilldown" : "050" + }, + { + "y" : 89, + "drilldown" : "051", + "name" : "#051" + }, + { + "name" : "#052", |
