diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2019-08-12 12:14:19 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2019-08-12 12:14:19 +0100 |
| commit | 3c0bf54725c59a737f75c5db8eddc79d82ca2426 (patch) | |
| tree | 6ba2a047c1a956bf5933f0ad0de68cb7f2e704ab | |
| parent | e6409b837ec59be1986e3ef420607961ab47ba9d (diff) | |
| download | perlweeklychallenge-club-3c0bf54725c59a737f75c5db8eddc79d82ca2426.tar.gz perlweeklychallenge-club-3c0bf54725c59a737f75c5db8eddc79d82ca2426.tar.bz2 perlweeklychallenge-club-3c0bf54725c59a737f75c5db8eddc79d82ca2426.zip | |
- Added solutions by Mark Senn.
| -rw-r--r-- | challenge-020/mark-senn/blog.txt | 1 | ||||
| -rw-r--r-- | challenge-020/mark-senn/blog1.txt | 1 | ||||
| -rw-r--r-- | challenge-020/mark-senn/perl6/ch-1.p6 | 46 | ||||
| -rw-r--r-- | challenge-020/mark-senn/perl6/ch-2.p6 | 42 | ||||
| -rw-r--r-- | stats/pwc-current.json | 285 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 80 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 324 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 614 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 114 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 108 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 38 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 64 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 264 |
13 files changed, 1045 insertions, 936 deletions
diff --git a/challenge-020/mark-senn/blog.txt b/challenge-020/mark-senn/blog.txt new file mode 100644 index 0000000000..348e2c8449 --- /dev/null +++ b/challenge-020/mark-senn/blog.txt @@ -0,0 +1 @@ +https://engineering.purdue.edu/~mark/pwc-020-1.pdf diff --git a/challenge-020/mark-senn/blog1.txt b/challenge-020/mark-senn/blog1.txt new file mode 100644 index 0000000000..d46349b7b6 --- /dev/null +++ b/challenge-020/mark-senn/blog1.txt @@ -0,0 +1 @@ +https://engineering.purdue.edu/~mark/pwc-020-2.pdf diff --git a/challenge-020/mark-senn/perl6/ch-1.p6 b/challenge-020/mark-senn/perl6/ch-1.p6 new file mode 100644 index 0000000000..eeaae46b8f --- /dev/null +++ b/challenge-020/mark-senn/perl6/ch-1.p6 @@ -0,0 +1,46 @@ +# +# Perl Weekly Challenge - 020 +# Task #1 +# +# See +# engineering.purdue.edu/~mark/pwc -020 -1. pdf +# for more information. + +# Run using Perl v6.d. +use v6.d; + +# See1 +# https :// docs.perl6.org/routine/MAIN +# for how to define a MAIN sub. For this program , only +# a single string from the command line needs to be +# accepted with no options and the following will suffice. +# This is nice because if I used a sub MAIN here , I would +# put all of the code below indented inside the sub MAIN +# and would need to reduce the font size so it would fit +# on the page. +$_ = shift @*ARGS; + +# The Perl 6 regex +# /((.){}$0 *)*/; +# with no comments could be used. For this regex I prefer +# commenting it like below to explain it to people who may +# have not used regexes before. + +# Search for the quoted comments in the code below in3 +# https :// docs.perl6.org/language/regexes +# for more information. +/ # Start a Perl 6 regex (called "regular expression" in Perl 5). + ( # Start a group to match a string of identical characters. + (.) # Match a single character. + {} # "This code block publishes the capture inside the + # regex , so that it can be assigned to other variables + # or used for subsequent matches ." + $0* # Match the previously matched character + # zero or more times. + )* # End the group to match a string of identical characters. + # There are zero or more groups of identical characters. +/; # End the Perl 6 regex. + +# "Coercing the match object to a list gives an easy way +# to programmatically access all elements :" +say$/.list.join; diff --git a/challenge-020/mark-senn/perl6/ch-2.p6 b/challenge-020/mark-senn/perl6/ch-2.p6 new file mode 100644 index 0000000000..117a3f825a --- /dev/null +++ b/challenge-020/mark-senn/perl6/ch-2.p6 @@ -0,0 +1,42 @@ +# +# Perl Weekly Challenge - 020 +# Task #2 +# +# See +# engineering.purdue.edu/~mark/pwc -020 -2. pdf +# for more information.8 + +# Run using Perl v6.d. +use v6.d; + +# Set @sum[$i] to the sum of the proper divisors of $i. +my int @sum; + +for 2 .. * ->$i { + + # The proper divisors of a prime is a set consisting only of 1. + # All primes can be skipped. + ($i.is-prime) and next; + + # Compute the sum of the proper divisors of$i. + my $sum = 1; + # The largest proper divisor of$i is ($i/2). floor. + for 2 .. ($i/2). Int ->$j { + ($i %%$j) and $sum +=$j; + } + + # Remember the sum of the proper divisors of $i. + @sum[$i] =$sum; + + # If$sum > $i , @sum[$sum] has not been computed yet and + # can't be used for comparision. + # If $sum == $i the pair of numbers would be ($i ,$i), + # a pair using two different numbers is needed. + # In either case we can skip the rest of the loop. + ($sum >=$i) and next; + + if (@sum[$sum] ==$i) { + say "$sum $i"; + last; + } +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 88dca725df..91f4336a6c 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,20 +1,9 @@ { - "title" : { - "text" : "Perl Weekly Challenge - 020" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - } - } - }, "drilldown" : { "series" : [ { "id" : "Adam Russell", + "name" : "Adam Russell", "data" : [ [ "Perl 5", @@ -28,20 +17,21 @@ "Blog", 1 ] - ], - "name" : "Adam Russell" + ] }, { "name" : "Andrezgz", + "id" : "Andrezgz", "data" : [ [ "Perl 5", 2 ] - ], - "id" : "Andrezgz" + ] }, { + "id" : "Arne Sommer", + "name" : "Arne Sommer", "data" : [ [ "Perl 6", @@ -51,9 +41,7 @@ "Blog", 1 ] - ], - "id" : "Arne Sommer", - "name" : "Arne Sommer" + ] }, { "data" : [ @@ -70,17 +58,18 @@ "name" : "Athanasius" }, { - "id" : "Daniel Mantovani", "data" : [ [ "Perl 5", 2 ] ], - "name" : "Daniel Mantovani" + "name" : "Daniel Mantovani", + "id" : "Daniel Mantovani" }, { "name" : "Dave Jacoby", + "id" : "Dave Jacoby", "data" : [ [ "Perl 5", @@ -90,12 +79,11 @@ "Blog", 1 ] - ], - "id" : "Dave Jacoby" + ] }, { - "name" : "Duane Powell", "id" : "Duane Powell", + "name" : "Duane Powell", "data" : [ [ "Perl 5", @@ -104,17 +92,18 @@ ] }, { - "name" : "Duncan C. White", - "id" : "Duncan C. White", "data" : [ [ "Perl 5", 2 ] - ] + ], + "id" : "Duncan C. White", + "name" : "Duncan C. White" }, { "id" : "E. Choroba", + "name" : "E. Choroba", "data" : [ [ "Perl 5", @@ -124,11 +113,9 @@ "Blog", 1 ] - ], - "name" : "E. Choroba" + ] }, { - "name" : "Feng Chang", "data" : [ [ "Perl 5", @@ -139,40 +126,40 @@ 2 ] ], - "id" : "Feng Chang" + "id" : "Feng Chang", + "name" : "Feng Chang" }, { + "id" : "Francis Whittle", "name" : "Francis Whittle", "data" : [ [ "Perl 6", 2 ] - ], - "id" : "Francis Whittle" + ] }, { - "name" : "Guillermo Ramos", - "id" : "Guillermo Ramos", "data" : [ [ "Perl 5", 2 ] - ] + ], + "name" : "Guillermo Ramos", + "id" : "Guillermo Ramos" }, { "name" : "Gustavo Chaves", + "id" : "Gustavo Chaves", "data" : [ [ "Perl 5", 2 ] - ], - "id" : "Gustavo Chaves" + ] }, { - "id" : "Jaldhar H. Vyas", "data" : [ [ "Perl 5", @@ -187,11 +174,12 @@ 1 ] ], + "id" : "Jaldhar H. Vyas", "name" : "Jaldhar H. Vyas" }, { - "name" : "Joelle Maslak", "id" : "Joelle Maslak", + "name" : "Joelle Maslak", "data" : [ [ "Perl 5", @@ -214,16 +202,17 @@ "name" : "Kevin Colyer" }, { - "id" : "Kian-Meng Ang", "data" : [ [ "Perl 5", 2 ] ], - "name" : "Kian-Meng Ang" + "name" : "Kian-Meng Ang", + "id" : "Kian-Meng Ang" }, { + "id" : "Laurent Rosenfeld", "name" : "Laurent Rosenfeld", "data" : [ [ @@ -238,28 +227,41 @@ "Blog", 1 ] - ], - "id" : "Laurent Rosenfeld" + ] }, { - "id" : "Lubos Kolouch", "data" : [ [ "Perl 5", 2 ] ], - "name" : "Lubos Kolouch" + "name" : "Lubos Kolouch", + "id" : "Lubos Kolouch" }, { + "name" : "Mark Anderson", + "id" : "Mark Anderson", "data" : [ [ "Perl 5", 2 ] + ] + }, + { + "data" : [ + [ + "Perl 6", + 2 + ], + [ + "Blog", + 2 + ] ], - "id" : "Mark Anderson", - "name" : "Mark Anderson" + "id" : "Mark Senn", + "name" : "Mark Senn" }, { "data" : [ @@ -272,57 +274,58 @@ "name" : "Martin Barth" }, { - "id" : "Noud", "data" : [ [ "Perl 6", 2 ] ], + "id" : "Noud", "name" : "Noud" }, { - "name" : "Ozzy", - "id" : "Ozzy", "data" : [ [ "Perl 6", 1 ] - ] + ], + "id" : "Ozzy", + "name" : "Ozzy" }, { - "name" : "Pete Houston", - "id" : "Pete Houston", "data" : [ [ "Perl 5", 1 ] - ] + ], + "id" : "Pete Houston", + "name" : "Pete Houston" }, { + "name" : "Peter Scott", + "id" : "Peter Scott", "data" : [ [ "Perl 5", 1 ] - ], - "id" : "Peter Scott", - "name" : "Peter Scott" + ] }, { + "id" : "Randy Lauen", + "name" : "Randy Lauen", "data" : [ [ "Perl 6", 2 ] - ], - "id" : "Randy Lauen", - "name" : "Randy Lauen" + ] }, { "name" : "Roger Bell West", + "id" : "Roger Bell West", "data" : [ [ "Perl 5", @@ -332,10 +335,11 @@ "Perl 6", 2 ] - ], - "id" : "Roger Bell West" + ] }, { + "name" : "Ruben Westerberg", + "id" : "Ruben Westerberg", "data" : [ [ "Perl 5", @@ -345,29 +349,27 @@ "Perl 6", 2 ] - ], - "id" : "Ruben Westerberg", - "name" : "Ruben Westerberg" + ] }, { + "name" : "Simon Proctor", "id" : "Simon Proctor", "data" : [ [ "Perl 6", 2 ] - ], - "name" : "Simon Proctor" + ] }, { + "id" : "Steven Wilson", "name" : "Steven Wilson", "data" : [ [ "Perl 5", 2 ] - ], - "id" : "Steven Wilson" + ] }, { "name" : "Veesh Goldman", @@ -385,31 +387,45 @@ } ] }, - "xAxis" : { - "type" : "category" + "title" : { + "text" : "Perl Weekly Challenge - 020" }, - "chart" : { - "type" : "column" + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } }, - "subtitle" : { - "text" : "[Champions: 31] Last updated at 2019-08-12 10:48:12 GMT" + "legend" : { + "enabled" : 0 + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "xAxis" : { + "type" : "category" }, "series" : [ { "data" : [ { + "drilldown" : "Adam Russell", "y" : 5, - "name" : "Adam Russell", - "drilldown" : "Adam Russell" + "name" : "Adam Russell" }, { - "name" : "Andrezgz", "drilldown" : "Andrezgz", - "y" : 2 + "y" : 2, + "name" : "Andrezgz" }, { - "y" : 3, "name" : "Arne Sommer", + "y" : 3, "drilldown" : "Arne Sommer" }, { @@ -419,17 +435,17 @@ }, { "y" : 2, - "drilldown" : "Daniel Mantovani", - "name" : "Daniel Mantovani" + "name" : "Daniel Mantovani", + "drilldown" : "Daniel Mantovani" }, { - "drilldown" : "Dave Jacoby", "name" : "Dave Jacoby", - "y" : 3 + "y" : 3, + "drilldown" : "Dave Jacoby" }, { - "y" : 2, "name" : "Duane Powell", + "y" : 2, "drilldown" : "Duane Powell" }, { @@ -438,94 +454,99 @@ "y" : 2 }, { - "drilldown" : "E. Choroba", + "y" : 3, "name" : "E. Choroba", - "y" : 3 + "drilldown" : "E. Choroba" }, { - "y" : 4, "name" : "Feng Chang", + "y" : 4, "drilldown" : "Feng Chang" }, { "y" : 2, - "drilldown" : "Francis Whittle", - "name" : "Francis Whittle" + "name" : "Francis Whittle", + "drilldown" : "Francis Whittle" }, { - "y" : 2, "name" : "Guillermo Ramos", + "y" : 2, "drilldown" : "Guillermo Ramos" }, { - "name" : "Gustavo Chaves", "drilldown" : "Gustavo Chaves", - "y" : 2 + "y" : 2, + "name" : "Gustavo Chaves" }, { - "y" : 5, "name" : "Jaldhar H. Vyas", + "y" : 5, "drilldown" : "Jaldhar H. Vyas" }, { "drilldown" : "Joelle Maslak", - "name" : "Joelle Maslak", - "y" : 6 + "y" : 6, + "name" : "Joelle Maslak" }, { "name" : "Kevin Colyer", - "drilldown" : "Kevin Colyer", - "y" : 2 + "y" : 2, + "drilldown" : "Kevin Colyer" }, { + "name" : "Kian-Meng Ang", "y" : 2, - "drilldown" : "Kian-Meng Ang", - "name" : "Kian-Meng Ang" + "drilldown" : "Kian-Meng Ang" }, { "y" : 5, - "drilldown" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld" + "name" : "Laurent Rosenfeld", + "drilldown" : "Laurent Rosenfeld" }, { "y" : 2, - "drilldown" : "Lubos Kolouch", - "name" : "Lubos Kolouch" + "name" : "Lubos Kolouch", + "drilldown" : "Lubos Kolouch" }, { + "y" : 2, "name" : "Mark Anderson", - "drilldown" : "Mark Anderson", - "y" : 2 + "drilldown" : "Mark Anderson" + }, + { + "drilldown" : "Mark Senn", + "name" : "Mark Senn", + "y" : 4 }, { "name" : "Martin Barth", - "drilldown" : "Martin Barth", - "y" : 1 + "y" : 1, + "drilldown" : "Martin Barth" }, { "name" : "Noud", - "drilldown" : "Noud", - "y" : 2 + "y" : 2, + "drilldown" : "Noud" }, { - "name" : "Ozzy", "drilldown" : "Ozzy", - "y" : 1 + "y" : 1, + "name" : "Ozzy" }, { - "drilldown" : "Pete Houston", + "y" : 1, "name" : "Pete Houston", - "y" : 1 + "drilldown" : "Pete Houston" }, { + "drilldown" : "Peter Scott", "y" : 1, - "name" : "Peter Scott", - "drilldown" : "Peter Scott" + "name" : "Peter Scott" }, { "drilldown" : "Randy Lauen", - "name" : "Randy Lauen", - "y" : 2 + "y" : 2, + "name" : "Randy Lauen" }, { "y" : 4, @@ -533,9 +554,9 @@ "drilldown" : "Roger Bell West" }, { - "y" : 4, "drilldown" : "Ruben Westerberg", - "name" : "Ruben Westerberg" + "name" : "Ruben Westerberg", + "y" : 4 }, { "y" : 2, @@ -543,13 +564,13 @@ "drilldown" : "Simon Proctor" }, { - "y" : 2, "drilldown" : "Steven Wilson", - "name" : "Steven Wilson" + "name" : "Steven Wilson", + "y" : 2 }, { - "name" : "Veesh Goldman", "drilldown" : "Veesh Goldman", + "name" : "Veesh Goldman", "y" : 3 } ], @@ -557,17 +578,15 @@ "colorByPoint" : 1 } ], - "legend" : { - "enabled" : 0 + "chart" : { + "type" : "column" + }, + "subtitle" : { + "text" : "[Champions: 32] Last updated at 2019-08-12 11:13:45 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, - "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } + "followPointer" : 1 } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 0cb121ca41..9307b1ccc6 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,14 +1,50 @@ { "subtitle" : { - "text" : "Last updated at 2019-08-12 10:48:22 GMT" + "text" : "Last updated at 2019-08-12 11:14:08 GMT" + }, + "yAxis" : { + "min" : 0, + "title" : { + "text" : null + } + }, + "title" : { + "text" : "Perl Weekly Challenge Contributions - 2019" + }, + "chart" : { + "type" : "column" + }, + "legend" : { + "enabled" : "false" + }, + "xAxis" : { + "labels" : { + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + } + }, + "type" : "category" }, "series" : [ { "name" : "Contributions", + "dataLabels" : { + "y" : 10, + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + }, + "color" : "#FFFFFF", + "rotation" : -90, + "format" : "{point.y:.0f}", + "enabled" : "true", + "align" : "right" + }, "data" : [ [ "Blog", - 191 + 193 ], [ "Perl 5", @@ -16,48 +52,12 @@ ], [ "Perl 6", - 501 + 503 ] - ], - "dataLabels" : { - "format" : "{point.y:.0f}", - "enabled" : "true", - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - }, - "align" : "right", - "color" : "#FFFFFF", - "y" : 10, - "rotation" : -90 - } + ] } ], - "chart" : { - "type" : "column" - }, - "yAxis" : { - "title" : { - "text" : null - }, - "min" : 0 - }, - "xAxis" : { - "labels" : { - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - } - }, - "type" : "category" - }, "tooltip" : { "pointFormat" : "<b>{point.y:.0f}</b>" - }, - "title" : { - "text" : "Perl Weekly Challenge Contributions - 2019" - }, - "legend" : { - "enabled" : "false" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 0730864468..d3fdf4ba23 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,33 +1,121 @@ { - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } - } - }, - "legend" : { - "enabled" : "false" - }, "tooltip" : { - "followPointer" : "true", + "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>", "headerFormat" : "<span style=\"font-size:11px\"></span>", - "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>" - }, - "title" : { - "text" : "Perl Weekly Challenge Language" - }, - "xAxis" : { - "type" : "category" - }, - "chart" : { - "type" : "column" + "followPointer" : "true" }, + "series" : [ + { + "colorByPoint" : "true", + "data" : [ + { + "y" : 123, + "name" : "#001", + "drilldown" : "001" + }, + { + "drilldown" : "002", + "name" : "#002", + "y" : 104 + }, + { + "drilldown" : "003", + "y" : 66, + "name" : "#003" + }, + { + "name" : "#004", + "y" : 84, + "drilldown" : "004" + }, + { + "drilldown" : "005", + "name" : "#005", + "y" : 66 + }, + { + "name" : "#006", + "y" : 47, + "drilldown" : "006" + }, + { + "drilldown" : "007", + "y" : 54, + "name" : "#007" + }, + { + "y" : 67, + "name" : "#008", + "drilldown" : "008" + }, + { + "y" : 65, + "name" : "#009", + "drilldown" : "009" + }, + { + "drilldown" : "010", + "y" : 58, + "name" : "#010" + }, + { + "name" : "#011", + "y" : 77, + "drilldown" : "011" + }, + { + "y" : 81, + "name" : "#012", + "drilldown" : "012" + }, + { + "y" : 74, + "name" : "#013", + "drilldown" : "013" + }, + { + "drilldown" : "014", + "name" : "#014", + "y" : 94 + }, + { + "drilldown" : "015", + "y" : 90, + "name" : "#015" + }, + { + "drilldown" : "016", + "y" : 64, + "name" : "#016" + }, + { + "name" : "#017", + "y" : 77, + "drilldown" : "017" + }, + { + "drilldown" : "018", + "name" : "#018", + "y" : 73 + }, + { + "drilldown" : "019", + "name" : "#019", + "y" : 92 + }, + { + "y" : 88, + "name" : "#020", + "drilldown" : "020" + } + ], + "name" : "Perl Weekly Challenge Languages" + } + ], "drilldown" : { "series" : [ { + "name" : "001", "id" : "001", "data" : [ [ @@ -42,10 +130,10 @@ "Blog", 10 ] - ], - "name" : "001" + ] }, { + "name" : "002", "data" : [ [ "Perl 5", @@ -60,11 +148,10 @@ 9 ] ], - "id" : "002", - "name" : "002" + "id" : "002" }, { - "id" : "003", + "name" : "003", "data" : [ [ "Perl 5", @@ -79,10 +166,9 @@ 8 ] ], - "name" : "003" + "id" : "003" }, { - "name" : "004", "id" : "004", "data" : [ [ @@ -97,7 +183,8 @@ "Blog", 9 ] - ] + ], + "name" : "004" }, { "id" : "005", @@ -154,7 +241,6 @@ "name" : "007" }, { - "name" : "008", "data" : [ [ "Perl 5", @@ -169,10 +255,10 @@ 9 ] ], |
