diff options
| -rwxr-xr-x | challenge-137/pete-houston/awk/ch-2.awk | 42 | ||||
| -rwxr-xr-x | challenge-137/pete-houston/perl/ch-1.pl | 39 | ||||
| -rwxr-xr-x | challenge-137/pete-houston/perl/ch-2.pl | 40 | ||||
| -rw-r--r-- | stats/pwc-current.json | 237 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 44 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 1890 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 360 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 38 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 56 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 44 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 104 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 20 | ||||
| -rw-r--r-- | stats/pwc-summary-241-270.json | 24 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 96 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 46 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 52 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 22 |
17 files changed, 1645 insertions, 1509 deletions
diff --git a/challenge-137/pete-houston/awk/ch-2.awk b/challenge-137/pete-houston/awk/ch-2.awk new file mode 100755 index 0000000000..dd1962e370 --- /dev/null +++ b/challenge-137/pete-houston/awk/ch-2.awk @@ -0,0 +1,42 @@ +#!/usr/bin/gawk -f
+#===============================================================================
+#
+# FILE: 13702.awk
+#
+# USAGE: ./13702.pl
+#
+# DESCRIPTION: Lychrel numbers on STDIN output 1, 0 otherwise.
+#
+# AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk
+# ORGANIZATION: Openstrike
+# VERSION: 1.0
+# CREATED: 03/11/21
+#===============================================================================
+
+function reverse (str) {
+ rev = ""
+ for (j = length (str); j > 0; j--) {
+ rev = rev substr (str, j, 1)
+ }
+ return rev
+}
+
+/^[1-9][0-9]{1,3}$/ {
+ maxn = 10000000
+ maxiter = 500
+ n = $0
+ for (i = 1; i < maxiter; i++) {
+ revn = reverse(n)
+ if (revn == n) {
+ print "0"
+ next
+ }
+ n += revn
+ if (n > maxn) {
+ print "1"
+ next
+ }
+ }
+ print "1"
+ next
+}
diff --git a/challenge-137/pete-houston/perl/ch-1.pl b/challenge-137/pete-houston/perl/ch-1.pl new file mode 100755 index 0000000000..125ec0a814 --- /dev/null +++ b/challenge-137/pete-houston/perl/ch-1.pl @@ -0,0 +1,39 @@ +#!/usr/bin/env perl +#=============================================================================== +# +# FILE: 13701.pl +# +# USAGE: ./13701.pl +# +# DESCRIPTION: List years between 1900 and 2100 which have 53 weeks. +# +# REQUIREMENTS: Time::Piece +# AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk +# ORGANIZATION: Openstrike +# VERSION: 1.0 +# CREATED: 01/11/21 +#=============================================================================== + +use strict; +use warnings; + +use Time::Piece (); + +# A year clearly cannot have 53 weeks, So what is this task supposed to mean? +# A dig into the Time::Piece docs reveals when the week number can be 53 +# so we'll take that as the definition. It seems to fit the given results. +# https://metacpan.org/pod/Time::Piece#Week-Number + +my $skip = 0; +for my $year (1900 .. 2100) { + next if $year == $skip; + if (weeks_in_year ($year) > 52) { + print "$year "; + $skip = $year + 1; # Cannot have 2 in succession, so skip it + } +} + +sub weeks_in_year { + my $y = shift; + return Time::Piece->strptime ("$y-12-31", '%Y-%m-%d')->week; +} diff --git a/challenge-137/pete-houston/perl/ch-2.pl b/challenge-137/pete-houston/perl/ch-2.pl new file mode 100755 index 0000000000..4325e06c8f --- /dev/null +++ b/challenge-137/pete-houston/perl/ch-2.pl @@ -0,0 +1,40 @@ +#!/usr/bin/env perl +#=============================================================================== +# +# FILE: 13702.pl +# +# USAGE: ./13702.pl [-v] N +# +# DESCRIPTION: Print 1 if N is a Lychrel number, 0 otherwise +# +# OPTIONS: -v gives verbose output +# REQUIREMENTS: Getopt::Long::Modern +# NOTES: Values of $maxn and $maxiter are as specified in the task +# AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk +# ORGANIZATION: Openstrike +# VERSION: 1.0 +# CREATED: 01/11/21 +#=============================================================================== + +use strict; +use warnings; +use Getopt::Long::Modern; + +GetOptions (v => \my $verbose); + +my $maxn = 10_000_000; +my $maxiter = 500; +my $n = shift; + +die "Bad argument: must be integer between 10 and 1000 inclusive.\n" + unless defined ($n) && $n =~ /^[1-9][0-9]{1,3}$/; + +for (1..$maxiter) { + my $rev = reverse $n; + if ($rev eq $n) { print "0\n"; exit; } + print "$n + $rev = " if $verbose; + $n += $rev; + print "$n\n" if $verbose; + if ($n > $maxn) { print "1 (Total of $n is above $maxn)\n"; exit; } +} +print "1 (Reached $maxiter iterations)\n"; diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 742595f96f..88c13b2521 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,19 +1,22 @@ { + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "subtitle" : { + "text" : "[Champions: 28] Last updated at 2021-11-07 18:41:23 GMT" + }, + "legend" : { + "enabled" : 0 + }, "plotOptions" : { "series" : { + "borderWidth" : 0, "dataLabels" : { "enabled" : 1, "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, - "chart" : { - "type" : "column" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" + } } }, "drilldown" : { @@ -25,18 +28,18 @@ 2 ] ], - "id" : "Abigail", - "name" : "Abigail" + "name" : "Abigail", + "id" : "Abigail" }, { - "name" : "Andrew Shitov", "id" : "Andrew Shitov", "data" : [ [ "Raku", 1 ] - ] + ], + "name" : "Andrew Shitov" }, { "data" : [ @@ -53,11 +56,10 @@ 1 ] ], - "id" : "Arne Sommer", - "name" : "Arne Sommer" + "name" : "Arne Sommer", + "id" : "Arne Sommer" }, { - "name" : "Athanasius", "data" : [ [ "Perl", @@ -68,39 +70,41 @@ 2 ] ], + "name" : "Athanasius", "id" : "Athanasius" }, { + "name" : "Bob Lied", "data" : [ [ "Perl", 2 ] ], - "id" : "Bob Lied", - "name" : "Bob Lied" + "id" : "Bob Lied" }, { - "id" : "Cheok-Yin Fung", + "name" : "Cheok-Yin Fung", "data" : [ [ "Perl", 2 ] ], - "name" : "Cheok-Yin Fung" + "id" : "Cheok-Yin Fung" }, { + "id" : "E. Choroba", "name" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ], - "id" : "E. Choroba" + ] }, { + "id" : "Flavio Poletti", "name" : "Flavio Poletti", "data" : [ [ @@ -115,8 +119,7 @@ "Blog", 2 ] - ], - "id" : "Flavio Poletti" + ] }, { "id" : "James Smith", @@ -144,17 +147,17 @@ }, { "name" : "Jorg Sommrey", - "id" : "Jorg Sommrey", "data" : [ [ "Perl", 1 ] - ] + ], + "id" : "Jorg Sommrey" }, { - "name" : "Laurent Rosenfeld", "id" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -172,17 +175,15 @@ }, { "id" : "Lubos Kolouch", + "name" : "Lubos Kolouch", "data" : [ [ "Perl", 2 ] - ], - "name" : "Lubos Kolouch" + ] }, { - "name" : "Luca Ferrari", - "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -192,26 +193,28 @@ "Blog", 4 ] - ] + ], + "name" : "Luca Ferrari", + "id" : "Luca Ferrari" }, { + "id" : "Mark Anderson", + "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ], - "id" : "Mark Anderson", - "name" : "Mark Anderson" + ] }, { + "id" : "Matthew Neleigh", "data" : [ [ "Perl", 2 ] ], - "id" : "Matthew Neleigh", "name" : "Matthew Neleigh" }, { @@ -230,46 +233,55 @@ }, { "id" : "Niels van Dijke", + "name" : "Niels van Dijke", "data" : [ [ "Perl", 2 ] - ], - "name" : "Niels van Dijke" + ] }, { - "id" : "Olivier Delouya", + "name" : "Olivier Delouya", "data" : [ [ "Perl", 2 ] ], - "name" : "Olivier Delouya" + "id" : "Olivier Delouya" }, { "id" : "Paulo Custodio", + "name" : "Paulo Custodio", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "name" : "Pete Houston", "data" : [ [ "Perl", 2 ] ], - "name" : "Paulo Custodio" + "id" : "Pete Houston" }, { - "name" : "Robert DiCicco", "data" : [ [ "Perl", 2 ] ], + "name" : "Robert DiCicco", "id" : "Robert DiCicco" }, { - "name" : "Roger Bell_West", "id" : "Roger Bell_West", "data" : [ [ @@ -284,7 +296,8 @@ "Blog", 1 ] - ] + ], + "name" : "Roger Bell_West" }, { "name" : "Simon Green", @@ -301,17 +314,18 @@ "id" : "Simon Green" }, { - "name" : "Steven Wilson", + "id" : "Steven Wilson", "data" : [ [ "Perl", 2 ] ], - "id" : "Steven Wilson" + "name" : "Steven Wilson" }, { "id" : "Ulrich Rieke", + "name" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -321,11 +335,10 @@ "Raku", 2 ] - ], - "name" : "Ulrich Rieke" + ] }, { - "id" : "W. Luis Mochan", + "name" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -336,55 +349,47 @@ 1 ] ], - "name" : "W. Luis Mochan" + "id" : "W. Luis Mochan" }, { - "id" : "Wanderdoc", + "name" : "Wanderdoc", "data" : [ [ "Perl", 2 ] ], - "name" : "Wanderdoc" + "id" : "Wanderdoc" } ] }, - "legend" : { - "enabled" : 0 - }, - "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/>" - }, - "xAxis" : { - "type" : "category" + "chart" : { + "type" : "column" }, "series" : [ { - "colorByPoint" : 1, "name" : "The Weekly Challenge - 137", + "colorByPoint" : 1, "data" : [ { - "name" : "Abigail", + "drilldown" : "Abigail", "y" : 2, - "drilldown" : "Abigail" + "name" : "Abigail" }, { + "name" : "Andrew Shitov", "y" : 1, - "drilldown" : "Andrew Shitov", - "name" : "Andrew Shitov" + "drilldown" : "Andrew Shitov" }, { + "y" : 5, "name" : "Arne Sommer", - "drilldown" : "Arne Sommer", - "y" : 5 + "drilldown" : "Arne Sommer" }, { - "name" : "Athanasius", "drilldown" : "Athanasius", - "y" : 4 + "y" : 4, + "name" : "Athanasius" }, { "name" : "Bob Lied", @@ -393,38 +398,38 @@ }, { "drilldown" : "Cheok-Yin Fung", - "y" : 2, - "name" : "Cheok-Yin Fung" + "name" : "Cheok-Yin Fung", + "y" : 2 }, { + "drilldown" : "E. Choroba", "name" : "E. Choroba", - "y" : 2, - "drilldown" : "E. Choroba" + "y" : 2 }, { "name" : "Flavio Poletti", - "drilldown" : "Flavio Poletti", - "y" : 6 + "y" : 6, + "drilldown" : "Flavio Poletti" }, { "y" : 3, - "drilldown" : "James Smith", - "name" : "James Smith" + "name" : "James Smith", + "drilldown" : "James Smith" }, { + "drilldown" : "Jan Krnavek", "name" : "Jan Krnavek", - "y" : 2, - "drilldown" : "Jan Krnavek" + "y" : 2 }, { - "y" : 1, "drilldown" : "Jorg Sommrey", + "y" : 1, "name" : "Jorg Sommrey" }, { + "name" : "Laurent Rosenfeld", "y" : 5, - "drilldown" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld" + "drilldown" : "Laurent Rosenfeld" }, { "drilldown" : "Lubos Kolouch", @@ -437,75 +442,85 @@ "name" : "Luca Ferrari" }, { + "name" : "Mark Anderson", "y" : 2, - "drilldown" : "Mark Anderson", - "name" : "Mark Anderson" + "drilldown" : "Mark Anderson" }, { - "drilldown" : "Matthew Neleigh", + "name" : "Matthew Neleigh", "y" : 2, - "name" : "Matthew Neleigh" + "drilldown" : "Matthew Neleigh" }, { - "name" : "Mohammad S Anwar", "drilldown" : "Mohammad S Anwar", + "name" : "Mohammad S Anwar", "y" : 2 }, { "y" : 2, - "drilldown" : "Niels van Dijke", - "name" : "Niels van Dijke" + "name" : "Niels van Dijke", + "drilldown" : "Niels van Dijke" }, { + "y" : 2, "name" : "Olivier Delouya", - "drilldown" : "Olivier Delouya", - "y" : 2 + "drilldown" : "Olivier Delouya" + }, + { + "y" : 2, + "name" : "Paulo Custodio", + "drilldown" : "Paulo Custodio" }, { + "name" : "Pete Houston", "y" : 2, - "drilldown" : "Paulo Custodio", - "name" : "Paulo Custodio" + "drilldown" : "Pete Houston" }, { - "drilldown" : "Robert DiCicco", + "name" : "Robert DiCicco", "y" : 2, - "name" : "Robert DiCicco" + "drilldown" : "Robert DiCicco" }, { + "y" : 5, "name" : "Roger Bell_West", - "drilldown" : "Roger Bell_West", - "y" : 5 + "drilldown" : "Roger Bell_West" }, { - "name" : "Simon Green", "drilldown" : "Simon Green", - "y" : 3 + "y" : 3, + "name" : "Simon Green" }, { + "y" : 2, "name" : "Steven Wilson", - "drilldown" : "Steven Wilson", - "y" : 2 + "drilldown" : "Steven Wilson" }, { - "y" : 4, "drilldown" : "Ulrich Rieke", + "y" : 4, "name" : "Ulrich Rieke" }, { - "name" : "W. Luis Mochan", + "drilldown" : "W. Luis Mochan", "y" : 3, - "drilldown" : "W. Luis Mochan" + "name" : "W. Luis Mochan" }, { "name" : "Wanderdoc", - "drilldown" : "Wanderdoc", - "y" : 2 + "y" : 2, + "drilldown" : "Wanderdoc" } ] } ], - "subtitle" : { - "text" : "[Champions: 27] Last updated at 2021-11-07 18:08:13 GMT" + "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/>" + }, + "xAxis" : { + "type" : "category" }, "title" : { "text" : "The Weekly Challenge - 137" diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index de8b422da7..b410de021f 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,31 +1,43 @@ { + "subtitle" : { + "text" : "Last updated at 2021-11-07 18:41:23 GMT" + }, + "legend" : { + "enabled" : "false" + }, "yAxis" : { - "min" : 0, "title" : { "text" : null - } + }, + "min" : 0 }, "chart" : { "type" : "column" }, - "title" : { - "text" : "The Weekly Challenge Contributions [2019 - 2021]" + "xAxis" : { + "type" : "category", + "labels" : { + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + } + } }, "series" : [ { - "name" : "Contributions", "dataLabels" : { "format" : "{point.y:.0f}", "enabled" : "true", "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" }, "y" : 10, "color" : "#FFFFFF", "align" : "right", "rotation" : -90 }, + "name" : "Contributions", "data" : [ [ "Blog", @@ -33,7 +45,7 @@ ], [ "Perl", - 6575 + 6577 ], [ "Raku", @@ -42,22 +54,10 @@ ] } ], - "subtitle" : { - "text" : "Last updated at 2021-11-07 18:08:13 GMT" - }, - "xAxis" : { - "labels" : { - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - } - }, - "type" : "category" - }, "tooltip" : { "pointFormat" : "<b>{point.y:.0f}</b>" }, - "legend" : { - "enabled" : "false" + "title" : { + "text" : "The Weekly Challenge Contributions [2019 - 2021]" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 03c1eba545..0b88bf1bc6 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,7 +1,711 @@ { + "xAxis" : { + "type" : "category" + }, + "series" : [ + { + "name" : "The Weekly Challenge Languages", + "colorByPoint" : "true", + "data" : [ + { + "y" : 161, + "name" : "#001", + "drilldown" : "001" + }, + { + "y" : 125, + "name" : "#002", + "drilldown" : "002" + }, + { + "name" : "#003", + "y" : 81, + "drilldown" : "003" + }, + { + "drilldown" : "004", + "name" : "#004", + "y" : 99 + }, + { + "name" : "#005", + "y" : 78, + "drilldown" : "005" + }, + { + "drilldown" : "006", + "y" : 58, + "name" : "#006" + }, + { + "name" : "#007", + "y" : 64, + "drilldown" : "007" + }, + { + "name" : "#008", + "y" : 78, + "drilldown" : "008" + }, + { + "drilldown" : "009", + "y" : 76, + "name" : "#009" + }, + { + "y" : 65, + "name" : "#010", + "drilldown" : "010" + }, + { + "name" : "#011", + "y" : 85, + "drilldown" : "011" + }, + { + "drilldown" : "012", + "name" : "#012", + "y" : 89 + }, + { + "drilldown" : "013", + "name" : "#013", + "y" : 85 + }, + { + "drilldown" : "014", + "name" : "#014", + "y" : 101 + }, + { + "drilldown" : "015", + "name" : "#015", + "y" : 99 + }, + { + "drilldown" : "016", + "y" : 71, + "name" : "#016" + }, + { + "name" : "#017", + "y" : 84, + "drilldown" : "017" + }, + { + "drilldown" : "018", + "y" : 81, + "name" : "#018" + }, + { + "y" : 103, + "name" : "#019", + "drilldown" : "019" + }, + { + "name" : "#020", + "y" : 101, + "drilldown" : "020" + }, + { + "drilldown" : "021", + "name" : "#021", + "y" : 72 + }, + { + "y" : 68, + "name" : "#022", + "drilldown" : "022" + }, + { + "name" : "#023", + "y" : 97, + "drilldown" : "023" + }, + { + "name" : "#024", + "y" : 75, + "drilldown" : "024" + }, + { + "drilldown" : "025", + "y" : 59, + "name" : "#025" + }, + { + "drilldown" : "026", + "name" : "#026", + "y" : 74 + }, + { + "drilldown" : "027", + "y" : 60, + "name" : "#027" + }, + { + "drilldown" : "028", + "name" : "#028", + "y" : 80 + }, + { + "drilldown" : "029", + "name" : "#029", + "y" : 79 + }, + { + "y" : 117, + "name" : "#030", + "drilldown" : "030" + }, + { + "y" : 89, + "name" : "#031", + "drilldown" : "031" + }, + { + "drilldown" : "032", + "y" : 94, + "name" : "#032" + }, + { + "drilldown" : "033", + "y" : 110, + "name" : "#033" + }, + { + "drilldown" : "034", + "y" : 64, + "name" : "#034" + }, + { + "y" : 64, + "name" : "#035", + "drilldown" : "035" + }, + { + "y" : 68, + "name" : "#036", + "drilldown" : "036" + }, + { + "name" : "#037", + "y" : 67, + "drilldown" : "037" + }, + { + "drilldown" : "038", + "y" : 68, + "name" : "#038" + }, + { + "name" : "#039", + "y" : 62, + "drilldown" : "039" + }, + { + "drilldown" : "040", + "name" : "#040", + "y" : 73 + }, + { + "name" : "#041", + "y" : 76, + "drilldown" : "041" + }, + { + "drilldown" : "042", + "name" : "#042", + "y" : 92 + }, + { + "drilldown" : "043", + "name" : "#043", + "y" : 68 + }, + { + "drilldown" : "044", + "name" : "#044", + "y" : 85 + }, + { + "y" : 96, + "name" : "#045", + "drilldown" : "045" + }, + { + "drilldown" : "046", + "name" : "#046", + "y" : 87 + }, + { + "y" : 84, + "name" : "#047", + "drilldown" : "047" + }, + { + "y" : 108, + "name" : "#048", + "drilldown" : "048" + }, + { + "y" : 89, + "name" : "#049", + "drilldown" : "049" + }, + { + "drilldown" : "050", + "y" : 98, + "name" : "#050" + }, + { + "name" : "#051", + "y" : 89, + "drilldown" : "051" + }, + { + "y" : 91, + "name" : "#052", + "drilldown" : "052" + }, + { + "name" : "#053", + "y" : 101, + "drilldown" : "053" + }, + { + "y" : 103, + "name" : "#054", + "drilldown" : "054" + }, + { + "drilldown" : "055", + "y" : 88, + "name" : "#055" + }, + { + "drilldown" : "056", + "y" : 95, + "name" : "#056" + }, + { + "y" : 80, + "name" : "#057", + "drilldown" : "057" + }, + { + "name" : "#058", + "y" : 69, + "drilldown" : "058" + }, + { + "drilldown" : "059", + "name" : "#059", + "y" : 89 + }, + { + "drilldown" : "060", + "y" : 85, + "name" : "#060" + }, + { + "drilldown" : "061", + |
