diff options
29 files changed, 1842 insertions, 1738 deletions
diff --git a/challenge-227/packy-anderson/README.md b/challenge-227/packy-anderson/README.md index 1b230ba294..1090bbe2aa 100644 --- a/challenge-227/packy-anderson/README.md +++ b/challenge-227/packy-anderson/README.md @@ -2,19 +2,19 @@ ## Perl -* [Task 1](perl/task-1.pl) +* [Task 1](perl/ch-1.pl) Sample output ``` -$ perl/task-1.pl 2023 +$ perl/ch-1.pl 2023 Input: $year = 2023 Output: 2 ``` -* [Task 2](perl/task-2.pl) +* [Task 2](perl/ch-2.pl) Sample output ``` -$ perl/task-2.pl < task-2-input.txt +$ perl/ch-2.pl < task-2-input.txt IV + V => IX M - I => CMXCIX X / II => V @@ -34,20 +34,20 @@ $ echo "X + Y" | perl/task-2.pl ## Raku -* [Task 1](raku/task-1.raku) +* [Task 1](raku/ch-1.raku) Sample output ``` -$ raku/task-1.raku 2023 +$ raku/ch-1.raku 2023 Input: $year = 2023 Output: 2 ``` -* [Task 2](raku/task-2.raku) +* [Task 2](raku/ch-2.raku) Sample output ``` -$ raku/task-2.raku < task-2-input.txt +$ raku/ch-2.raku < task-2-input.txt IV + V => IX M - I => CMXCIX X / II => V @@ -65,4 +65,4 @@ V - X => non potest (they didn't do negative numbers) ## Blog Post -[Perl Weekly Challenge 227](http://packy.dardan.com/2023/07/27/perl-weekly-challenge-227/)
\ No newline at end of file +[Perl Weekly Challenge 227](http://packy.dardan.com/2023/07/27/perl-weekly-challenge-227/) diff --git a/challenge-227/packy-anderson/perl/task-1.pl b/challenge-227/packy-anderson/perl/ch-1.pl index 1bfd2a1d13..1bfd2a1d13 100755 --- a/challenge-227/packy-anderson/perl/task-1.pl +++ b/challenge-227/packy-anderson/perl/ch-1.pl diff --git a/challenge-227/packy-anderson/perl/task-2.pl b/challenge-227/packy-anderson/perl/ch-2.pl index 425a4341ea..425a4341ea 100755 --- a/challenge-227/packy-anderson/perl/task-2.pl +++ b/challenge-227/packy-anderson/perl/ch-2.pl diff --git a/challenge-227/packy-anderson/raku/task-1.raku b/challenge-227/packy-anderson/raku/ch-1.raku index d9fef52c0d..d9fef52c0d 100755 --- a/challenge-227/packy-anderson/raku/task-1.raku +++ b/challenge-227/packy-anderson/raku/ch-1.raku diff --git a/challenge-227/packy-anderson/raku/task-2.raku b/challenge-227/packy-anderson/raku/ch-2.raku index 252340956f..252340956f 100755 --- a/challenge-227/packy-anderson/raku/task-2.raku +++ b/challenge-227/packy-anderson/raku/ch-2.raku diff --git a/challenge-228/laurent-rosenfeld/blog1.txt b/challenge-228/laurent-rosenfeld/blog1.txt new file mode 100644 index 0000000000..316b67dac8 --- /dev/null +++ b/challenge-228/laurent-rosenfeld/blog1.txt @@ -0,0 +1 @@ +https://blogs.perl.org/users/laurent_r/2023/08/perl-weekly-challenge-228-empty-array.html diff --git a/challenge-228/laurent-rosenfeld/perl/ch-2.pl b/challenge-228/laurent-rosenfeld/perl/ch-2.pl new file mode 100644 index 0000000000..dda950f48a --- /dev/null +++ b/challenge-228/laurent-rosenfeld/perl/ch-2.pl @@ -0,0 +1,26 @@ +use strict; +use warnings; +use feature 'say'; + +sub empty_array { + my @in = @_; + my $count = 0; + while (1) { + my $val = shift @in; + my $pushback = 0; + for my $item (@in) { + $pushback = 1 if $val > $item; + last if $pushback; + } + push @in, $val if $pushback; + $count++; + last unless @in; + } + return $count; +} + +for my $test ( [<3 4 2>], [<1 2 3>], + [<3 2 1>], [<4 7 2 9 1>] ) { + printf "%-10s => ", "@$test"; + say empty_array @$test; +} diff --git a/challenge-228/laurent-rosenfeld/raku/ch-2.raku b/challenge-228/laurent-rosenfeld/raku/ch-2.raku new file mode 100644 index 0000000000..605985b94f --- /dev/null +++ b/challenge-228/laurent-rosenfeld/raku/ch-2.raku @@ -0,0 +1,15 @@ +sub empty-array (@in is copy) { + my $count = 0; + loop { + my $val = shift @in; + push @in, $val if $val > @in.any; + $count++; + last unless @in; + } + return $count; +} + +for <3 4 2>, <1 2 3>, <3 2 1>, <4 7 2 9 1> -> @test { + printf "%-10s => ", "@test[]"; + say empty-array @test; +} diff --git a/challenge-228/packy-anderson/README.md b/challenge-228/packy-anderson/README.md index 481e8b2ced..c1bffd1725 100644 --- a/challenge-228/packy-anderson/README.md +++ b/challenge-228/packy-anderson/README.md @@ -2,33 +2,33 @@ ## Perl -* [Task 1](perl/task-1.pl) +* [Task 1](perl/ch-1.pl) Sample output ``` -$ perl/task-1.pl 2 1 3 2 +$ perl/ch-1.pl 2 1 3 2 Input: @int = (2, 1, 3, 2) Output: 4 In the given array we have 2 unique elements (1, 3). -$ perl/task-1.pl 1 1 1 1 +$ perl/ch-1.pl 1 1 1 1 Input: @int = (1, 1, 1, 1) Output: 0 In the given array no unique element found. -$ perl/task-1.pl 2 1 3 4 +$ perl/ch-1.pl 2 1 3 4 Input: @int = (2, 1, 3, 4) Output: 10 In the given array every element is unique. ``` -* [Task 2](perl/task-2.pl) +* [Task 2](perl/ch-2.pl) Sample output ``` -$ perl/task-2.pl 3 4 2 +$ perl/ch-2.pl 3 4 2 Input: @int = (3, 4, 2) Output: 5 @@ -38,7 +38,7 @@ Operation 3: remove element 2: (3,4) Operation 4: remove element 3: (4) Operation 5: remove element 4: () -$ perl/task-2.pl 1 2 3 +$ perl/ch-2.pl 1 2 3 Input: @int = (1, 2, 3) Output: 3 @@ -49,34 +49,34 @@ Operation 3: remove element 3: () ## Raku -* [Task 1](raku/task-1.raku) +* [Task 1](raku/ch-1.raku) Sample output ``` -$ raku/task-1.raku 2 1 3 2 +$ raku/ch-1.raku 2 1 3 2 Input: @int = (2, 1, 3, 2) Output: 4 In the given array we have 2 unique elements (1, 3). -$ raku/task-1.raku 1 1 1 1 +$ raku/ch-1.raku 1 1 1 1 Input: @int = (1, 1, 1, 1) Output: 0 In the given array no unique element found. -$ raku/task-1.raku 2 1 3 4 +$ raku/ch-1.raku 2 1 3 4 Input: @int = (2, 1, 3, 4) Output: 10 In the given array every element is unique. ``` -* [Task 2](raku/task-2.raku) +* [Task 2](raku/ch-2.raku) Sample output ``` -$ raku/task-2.raku 3 4 2 +$ raku/ch-2.raku 3 4 2 Input: @int = (3, 4, 2) Output: 5 @@ -86,7 +86,7 @@ Operation 3: remove element 2: (3, 4) Operation 4: remove element 3: (4) Operation 5: remove element 4: () -$ raku/task-2.raku 1 2 3 +$ raku/ch-2.raku 1 2 3 Input: @int = (1, 2, 3) Output: 3 @@ -97,4 +97,4 @@ Operation 3: remove element 3: () ## Blog Post -[Perl Weekly Challenge: Unique Sums and Empty Arrays](http://packy.dardan.com/2023/08/02/perl-weekly-challenge-unique-sums-and-empty-arrays/)
\ No newline at end of file +[Perl Weekly Challenge: Unique Sums and Empty Arrays](http://packy.dardan.com/2023/08/02/perl-weekly-challenge-unique-sums-and-empty-arrays/) diff --git a/challenge-228/packy-anderson/blog.txt b/challenge-228/packy-anderson/blog.txt new file mode 100644 index 0000000000..70a36d6de6 --- /dev/null +++ b/challenge-228/packy-anderson/blog.txt @@ -0,0 +1 @@ +http://packy.dardan.com/2023/08/02/perl-weekly-challenge-unique-sums-and-empty-arrays/ diff --git a/challenge-228/packy-anderson/perl/task-1.pl b/challenge-228/packy-anderson/perl/ch-1.pl index c92826b80d..c92826b80d 100755 --- a/challenge-228/packy-anderson/perl/task-1.pl +++ b/challenge-228/packy-anderson/perl/ch-1.pl diff --git a/challenge-228/packy-anderson/perl/task-2.pl b/challenge-228/packy-anderson/perl/ch-2.pl index 079c1391bb..079c1391bb 100755 --- a/challenge-228/packy-anderson/perl/task-2.pl +++ b/challenge-228/packy-anderson/perl/ch-2.pl diff --git a/challenge-228/packy-anderson/raku/task-1.raku b/challenge-228/packy-anderson/raku/ch-1.raku index f5221b310a..f5221b310a 100755 --- a/challenge-228/packy-anderson/raku/task-1.raku +++ b/challenge-228/packy-anderson/raku/ch-1.raku diff --git a/challenge-228/packy-anderson/raku/task-2.raku b/challenge-228/packy-anderson/raku/ch-2.raku index a7c75860bc..a7c75860bc 100755 --- a/challenge-228/packy-anderson/raku/task-2.raku +++ b/challenge-228/packy-anderson/raku/ch-2.raku diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 1d87e5b5e9..2f231d7134 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,43 +1,33 @@ { "subtitle" : { - "text" : "[Champions: 20] Last updated at 2023-08-01 17:47:54 GMT" + "text" : "[Champions: 23] Last updated at 2023-08-02 12:52:17 GMT" }, - "xAxis" : { - "type" : "category" - }, - "chart" : { - "type" : "column" + "legend" : { + "enabled" : 0 }, - "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 + "title" : { + "text" : "The Weekly Challenge - 228" }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } + "xAxis" : { + "type" : "category" }, "series" : [ { + "name" : "The Weekly Challenge - 228", "data" : [ { - "y" : 5, "drilldown" : "Ali Moradi", + "y" : 5, "name" : "Ali Moradi" }, { - "y" : 2, "drilldown" : "Andreas Voegele", + "y" : 2, "name" : "Andreas Voegele" }, { - "name" : "Bob Lied", "y" : 2, + "name" : "Bob Lied", "drilldown" : "Bob Lied" }, { @@ -51,49 +41,59 @@ "name" : "David Ferrone" }, { - "y" : 2, "drilldown" : "E. Choroba", - "name" : "E. Choroba" + "name" : "E. Choroba", + "y" : 2 }, { "y" : 5, - "drilldown" : "Jaldhar H. Vyas", - "name" : "Jaldhar H. Vyas" + "name" : "Jaldhar H. Vyas", + "drilldown" : "Jaldhar H. Vyas" }, { - "y" : 3, "drilldown" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld" + "name" : "Laurent Rosenfeld", + "y" : 6 }, { - "name" : "Lubos Kolouch", "drilldown" : "Lubos Kolouch", - "y" : 2 + "y" : 2, + "name" : "Lubos Kolouch" }, { - "drilldown" : "Luca Ferrari", "y" : 8, - "name" : "Luca Ferrari" + "name" : "Luca Ferrari", + "drilldown" : "Luca Ferrari" }, { - "name" : "Mariano Spadaccini", "y" : 1, + "name" : "Mariano Spadaccini", "drilldown" : "Mariano Spadaccini" }, { + "drilldown" : "Mark Anderson", "name" : "Mark Anderson", - "y" : 2, - "drilldown" : "Mark Anderson" + "y" : 4 + }, + { + "drilldown" : "Matthew Neleigh", + "name" : "Matthew Neleigh", + "y" : 2 }, { - "y" : 2, "drilldown" : "Niels van Dijke", - "name" : "Niels van Dijke" + "name" : "Niels van Dijke", + "y" : 2 }, { + "name" : "Packy Anderson", + "y" : 5, + "drilldown" : "Packy Anderson" + }, + { + "y" : 3, "name" : "Peter Campbell Smith", - "drilldown" : "Peter Campbell Smith", - "y" : 3 + "drilldown" : "Peter Campbell Smith" }, { "name" : "Peter Meszaros", @@ -101,47 +101,48 @@ "drilldown" : "Peter Meszaros" }, { - "name" : "Robert DiCicco", + "drilldown" : "Robbie Hatley", + "y" : 3, + "name" : "Robbie Hatley" + }, + { "drilldown" : "Robert DiCicco", + "name" : "Robert DiCicco", "y" : 4 }, { - "name" : "Steven Wilson", + "drilldown" : "Steven Wilson", "y" : 2, - "drilldown" : "Steven Wilson" + "name" : "Steven Wilson" }, { - "y" : 4, "drilldown" : "Thomas Kohler", + "y" : 4, "name" : "Thomas Kohler" }, { + "y" : 4, "name" : "Ulrich Rieke", - "drilldown" : "Ulrich Rieke", - "y" : 4 + "drilldown" : "Ulrich Rieke" }, { - "name" : "W. Luis Mochan", + "drilldown" : "W. Luis Mochan", "y" : 3, - "drilldown" : "W. Luis Mochan" + "name" : "W. Luis Mochan" } ], - "colorByPoint" : 1, - "name" : "The Weekly Challenge - 228" + "colorByPoint" : 1 } ], - "title" : { - "text" : "The Weekly Challenge - 228" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } + "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 }, "drilldown" : { "series" : [ { - "name" : "Ali Moradi", + "id" : "Ali Moradi", "data" : [ [ "Perl", @@ -156,7 +157,7 @@ 1 ] ], - "id" : "Ali Moradi" + "name" : "Ali Moradi" }, { "id" : "Andreas Voegele", @@ -169,17 +170,18 @@ "name" : "Andreas Voegele" }, { - "id" : "Bob Lied", "data" : [ [ "Perl", 2 ] ], + "id" : "Bob Lied", "name" : "Bob Lied" }, { "name" : "Dave Jacoby", + "id" : "Dave Jacoby", "data" : [ [ "Perl", @@ -189,18 +191,17 @@ "Blog", 1 ] - ], - "id" : "Dave Jacoby" + ] }, { - "name" : "David Ferrone", + "id" : "David Ferrone", "data" : [ [ "Perl", 2 ] ], - "id" : "David Ferrone" + "name" : "David Ferrone" }, { "name" : "E. Choroba", @@ -213,7 +214,6 @@ "id" : "E. Choroba" }, { - "id" : "Jaldhar H. Vyas", "data" : [ [ "Perl", @@ -228,6 +228,7 @@ 1 ] ], + "id" : "Jaldhar H. Vyas", "name" : "Jaldhar H. Vyas" }, { @@ -235,15 +236,15 @@ "data" : [ [ "Perl", - 1 + 2 ], [ "Raku", - 1 + 2 ], [ "Blog", - 1 + 2 ] ], "name" : "Laurent Rosenfeld" @@ -259,6 +260,7 @@ "name" : "Lubos Kolouch" }, { + "name" : "Luca Ferrari", "id" : "Luca Ferrari", "data" : [ [ @@ -269,12 +271,11 @@ "Blog", 6 ] - ], - "name" : "Luca Ferrari" + ] }, { - "id" : "Mariano Spadaccini", "name" : "Mariano Spadaccini", + "id" : "Mariano Spadaccini", "data" : [ [ "Perl", @@ -285,12 +286,16 @@ { "data" : [ [ + "Perl", + 2 + ], + [ "Raku", 2 ] ], - "name" : "Mark Anderson", - "id" : "Mark Anderson" + "id" : "Mark Anderson", + "name" : "Mark Anderson" }, { "data" : [ @@ -299,12 +304,40 @@ 2 ] ], - "name" : "Niels van Dijke", - "id" : "Niels van Dijke" + "id" : "Matthew Neleigh", + "name" : "Matthew Neleigh" + }, + { + "id" : "Niels van Dijke", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Niels van Dijke" + }, + { + "name" : "Packy Anderson", + "id" : "Packy Anderson", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ] }, { - "id" : "Peter Campbell Smith", "name" : "Peter Campbell Smith", + "id" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -323,8 +356,22 @@ 2 ] ], - "name" : "Peter Meszaros", - "id" : "Peter Meszaros" + "id" : "Peter Meszaros", + "name" : "Peter Meszaros" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Robbie Hatley", + "name" : "Robbie Hatley" }, { "name" : "Robert DiCicco", @@ -361,11 +408,11 @@ 2 ] ], - "name" : "Thomas Kohler", - "id" : "Thomas Kohler" + "id" : "Thomas Kohler", + "name" : "Thomas Kohler" }, { - "id" : "Ulrich Rieke", + "name" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -376,7 +423,7 @@ 2 ] ], - "name" : "Ulrich Rieke" + "id" : "Ulrich Rieke" }, { "name" : "W. Luis Mochan", @@ -394,7 +441,21 @@ } ] }, - "legend" : { - "enabled" : 0 + "chart" : { + "type" : "column" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + } + } + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 4a9d382fb8..76bf47bf08 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,63 +1,63 @@ { - "legend" : { - "enabled" : "false" - }, "yAxis" : { + "min" : 0, "title" : { "text" : null - }, - "min" : 0 + } + }, + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" }, "series" : [ { - "dataLabels" : { - "enabled" : "true", - "align" : "right", - "color" : "#FFFFFF", - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - }, - "format" : "{point.y:.0f}", - "y" : 10, - "rotation" : -90 - }, "data" : [ [ "Blog", - 3805 + 3808 ], [ "Perl", - 11672 + 11681 ], [ "Raku", - 6705 + 6708 ] ], - "name" : "Contributions" + "name" : "Contributions", + "dataLabels" : { + "y" : 10, + "align" : "right", + "rotation" : -90, + "format" : "{point.y:.0f}", + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + }, + "color" : "#FFFFFF", + "enabled" : "true" + } } ], + "chart" : { + "type" : "column" + }, "title" : { "text" : "The Weekly Challenge Contributions [2019 - 2023]" }, - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" - }, - "chart" : { - "type" : "column" + "legend" : { + "enabled" : "false" }, "xAxis" : { + "type" : "category", "labels" : { "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" } - }, - "type" : "category" + } }, "subtitle" : { - "text" : "Last updated at 2023-08-01 17:47:54 GMT" + "text" : "Last updated at 2023-08-02 12:52:16 GMT" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 828acaae00..a85c2f1c4e 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,19 +1,22 @@ { - "chart" : { - "type" : "column" - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2023-08-01 17:47:54 GMT" - }, - "xAxis" : { - "type" : "category" + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } }, - "legend" : { - "enabled" : "false" + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + } + } }, "drilldown" : { "series" : [ { + "name" : "001", "data" : [ [ "Perl", @@ -28,10 +31,11 @@ 11 ] ], - "name" : "001", "id" : "001" }, { + "name" : "002", + "id" : "002", "data" : [ [ "Perl", @@ -45,12 +49,11 @@ "Blog", 10 ] - ], - "name" : "002", - "id" : "002" + ] }, { "name" : "003", + "id" : "003", "data" : [ [ "Perl", @@ -64,10 +67,10 @@ "Blog", 9 ] - ], - "id" : "003" + ] }, { + "id" : "004", "data" : [ [ "Perl", @@ -82,8 +85,7 @@ 10 ] ], - "name" : "004", - "id" : "004" + "name" : "004" }, { "id" : "005", @@ -104,7 +106,7 @@ "name" : "005" }, { - |
