diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2021-11-20 09:54:38 +0000 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2021-11-20 09:54:38 +0000 |
| commit | 7b14c8a61e9ef869205501e383260dbac4212c86 (patch) | |
| tree | 7026f4f108b88d92a6957d815a0e35949b52cbee | |
| parent | e07c2ddd5c20d692cbfa5fc6fe8872c1a28e3737 (diff) | |
| download | perlweeklychallenge-club-7b14c8a61e9ef869205501e383260dbac4212c86.tar.gz perlweeklychallenge-club-7b14c8a61e9ef869205501e383260dbac4212c86.tar.bz2 perlweeklychallenge-club-7b14c8a61e9ef869205501e383260dbac4212c86.zip | |
- Added solutions to "JortSort" of week 139.
| -rw-r--r-- | challenge-139/mohammad-anwar/perl/ch-1.pl | 36 | ||||
| -rw-r--r-- | challenge-139/mohammad-anwar/raku/ch-1.raku | 36 | ||||
| -rw-r--r-- | stats/pwc-current.json | 213 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 76 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 960 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 366 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 54 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 50 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 46 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 98 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 126 | ||||
| -rw-r--r-- | stats/pwc-summary-241-270.json | 24 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 122 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 34 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 104 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 54 |
16 files changed, 1245 insertions, 1154 deletions
diff --git a/challenge-139/mohammad-anwar/perl/ch-1.pl b/challenge-139/mohammad-anwar/perl/ch-1.pl new file mode 100644 index 0000000000..e2351dc0fe --- /dev/null +++ b/challenge-139/mohammad-anwar/perl/ch-1.pl @@ -0,0 +1,36 @@ +#!/usr/bin/perl + +=head1 + +Week 139: + + https://theweeklychallenge.org/blog/perl-weekly-challenge-139 + +Task #1: JortSort + + You are given a list of numbers. + + Write a script to implement JortSort. It should return true/false depending if the given list of numbers are already sorted. + +=cut + +use strict; +use warnings; + +use Test::More; + +is(jortsort(1,2,3,4,5), 1, 'Example 1'); +is(jortsort(1,3,2,4,5), 0, 'Example 2'); + +done_testing; + +sub jortsort { + my (@n) = @_; + + my @s = sort @n; + foreach my $i (0 .. @n-1) { + return 0 if ($s[$i] != $n[$i]); + } + + return 1; +} diff --git a/challenge-139/mohammad-anwar/raku/ch-1.raku b/challenge-139/mohammad-anwar/raku/ch-1.raku new file mode 100644 index 0000000000..c7a0e2c6fd --- /dev/null +++ b/challenge-139/mohammad-anwar/raku/ch-1.raku @@ -0,0 +1,36 @@ +#!/usr/bin/env raku + +=begin pod + +Week 139: + + https://theweeklychallenge.org/blog/perl-weekly-challenge-139 + +Task #1: JortSort + + You are given a list of numbers. + + Write a script to implement JortSort. It should return true/false depending if the given list of numbers are already sorted. + +=end pod + +use Test; + +is jortsort([1,2,3,4,5]), True, 'Example 1'; +is jortsort([1,3,2,4,5]), False, 'Example 2'; + +done-testing; + +# +# +# METHODS + +sub jortsort(@n where @n.elems ~~ Int --> Bool) { + + my @s = @n.sort; + for 0 .. @n-1 -> $i { + return False if @n[$i] != @s[$i]; + } + + return True; +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 9e2f0f8319..493296cae1 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,11 +1,7 @@ { - "subtitle" : { - "text" : "[Champions: 24] Last updated at 2021-11-20 08:31:55 GMT" - }, "drilldown" : { "series" : [ { - "id" : "Abigail", "name" : "Abigail", "data" : [ [ @@ -16,20 +12,20 @@ "Blog", 2 ] - ] + ], + "id" : "Abigail" }, { + "id" : "Andrew Shitov", + "name" : "Andrew Shitov", "data" : [ [ "Raku", 1 ] - ], - "name" : "Andrew Shitov", - "id" : "Andrew Shitov" + ] }, { - "name" : "Athanasius", "data" : [ [ "Perl", @@ -40,16 +36,17 @@ 2 ] ], + "name" : "Athanasius", "id" : "Athanasius" }, { + "name" : "Cheok-Yin Fung", "data" : [ [ "Perl", 2 ] ], - "name" : "Cheok-Yin Fung", "id" : "Cheok-Yin Fung" }, { @@ -64,7 +61,6 @@ }, { "id" : "Dave Jacoby", - "name" : "Dave Jacoby", "data" : [ [ "Perl", @@ -74,7 +70,8 @@ "Blog", 1 ] - ] + ], + "name" : "Dave Jacoby" }, { "id" : "E. Choroba", @@ -88,6 +85,7 @@ }, { "id" : "Flavio Poletti", + "name" : "Flavio Poletti", "data" : [ [ "Perl", @@ -101,8 +99,7 @@ "Blog", 2 ] - ], - "name" : "Flavio Poletti" + ] }, { "id" : "James Smith", @@ -119,26 +116,27 @@ ] }, { - "name" : "Jan Krnavek", "data" : [ [ "Raku", 2 ] ], + "name" : "Jan Krnavek", "id" : "Jan Krnavek" }, { "id" : "Jorg Sommrey", - "name" : "Jorg Sommrey", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Jorg Sommrey" }, { + "id" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -153,8 +151,7 @@ 1 ] ], - "name" : "Laurent Rosenfeld", - "id" : "Laurent Rosenfeld" + "name" : "Laurent Rosenfeld" }, { "data" : [ @@ -181,57 +178,70 @@ "name" : "Mark Anderson" }, { + "name" : "Mohammad S Anwar", "data" : [ [ "Perl", - 2 + 1 + ], + [ + "Raku", + 1 ] ], + "id" : "Mohammad S Anwar" + }, + { + "id" : "Niels van Dijke", "name" : "Niels van Dijke", - "id" : "Niels van Dijke" + "data" : [ + [ + "Perl", + 2 + ] + ] }, { - "name" : "Olivier Delouya", "data" : [ [ "Perl", 1 ] ], + "name" : "Olivier Delouya", "id" : "Olivier Delouya" }, { - "id" : "Paulo Custodio", "data" : [ [ "Perl", 2 ] ], - "name" : "Paulo Custodio" + "name" : "Paulo Custodio", + "id" : "Paulo Custodio" }, { - "name" : "Peter Campbell Smith", "data" : [ [ "Perl", 2 ] ], + "name" : "Peter Campbell Smith", "id" : "Peter Campbell Smith" }, { - "name" : "Robert DiCicco", "data" : [ [ "Perl", 1 ] ], + "name" : "Robert DiCicco", "id" : "Robert DiCicco" }, { - "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -246,11 +256,11 @@ 1 ] ], - "name" : "Roger Bell_West" + "name" : "Roger Bell_West", + "id" : "Roger Bell_West" }, { "id" : "Simon Green", - "name" : "Simon Green", "data" : [ [ "Perl", @@ -260,20 +270,21 @@ "Blog", 1 ] - ] + ], + "name" : "Simon Green" }, { + "id" : "Steven Wilson", "name" : "Steven Wilson", "data" : [ [ "Perl", 1 ] - ], - "id" : "Steven Wilson" + ] }, { - "name" : "Ulrich Rieke", + "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -284,9 +295,10 @@ 2 ] ], - "id" : "Ulrich Rieke" + "name" : "Ulrich Rieke" }, { + "id" : "W. Luis Mochan", "name" : "W. Luis Mochan", "data" : [ [ @@ -297,79 +309,59 @@ "Blog", 1 ] - ], - "id" : "W. Luis Mochan" + ] } ] }, - "title" : { - "text" : "The Weekly Challenge - 139" - }, - "xAxis" : { - "type" : "category" - }, - "tooltip" : { - "followPointer" : 1, - "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/>" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } - } - }, "series" : [ { + "colorByPoint" : 1, "name" : "The Weekly Challenge - 139", "data" : [ { "name" : "Abigail", - "drilldown" : "Abigail", - "y" : 4 + "y" : 4, + "drilldown" : "Abigail" }, { + "drilldown" : "Andrew Shitov", "y" : 1, - "name" : "Andrew Shitov", - "drilldown" : "Andrew Shitov" + "name" : "Andrew Shitov" }, { - "drilldown" : "Athanasius", "name" : "Athanasius", - "y" : 4 + "y" : 4, + "drilldown" : "Athanasius" }, { "name" : "Cheok-Yin Fung", - "drilldown" : "Cheok-Yin Fung", - "y" : 2 + "y" : 2, + "drilldown" : "Cheok-Yin Fung" }, { "y" : 1, - "name" : "Cristina Heredia", - "drilldown" : "Cristina Heredia" + "drilldown" : "Cristina Heredia", + "name" : "Cristina Heredia" }, { - "name" : "Dave Jacoby", "drilldown" : "Dave Jacoby", - "y" : 3 + "y" : 3, + "name" : "Dave Jacoby" }, { - "y" : 2, "name" : "E. Choroba", - "drilldown" : "E. Choroba" + "drilldown" : "E. Choroba", + "y" : 2 }, { "y" : 6, - "name" : "Flavio Poletti", - "drilldown" : "Flavio Poletti" + "drilldown" : "Flavio Poletti", + "name" : "Flavio Poletti" }, { - "name" : "James Smith", + "y" : 3, "drilldown" : "James Smith", - "y" : 3 + "name" : "James Smith" }, { "name" : "Jan Krnavek", @@ -378,17 +370,17 @@ }, { "drilldown" : "Jorg Sommrey", - "name" : "Jorg Sommrey", - "y" : 2 + "y" : 2, + "name" : "Jorg Sommrey" }, { - "y" : 5, "name" : "Laurent Rosenfeld", + "y" : 5, "drilldown" : "Laurent Rosenfeld" }, { - "y" : 6, "drilldown" : "Luca Ferrari", + "y" : 6, "name" : "Luca Ferrari" }, { @@ -397,68 +389,95 @@ "name" : "Mark Anderson" }, { + "drilldown" : "Mohammad S Anwar", "y" : 2, + "name" : "Mohammad S Anwar" + }, + { "name" : "Niels van Dijke", + "y" : 2, "drilldown" : "Niels van Dijke" }, { - "y" : 1, "name" : "Olivier Delouya", + "y" : 1, "drilldown" : "Olivier Delouya" }, { + "name" : "Paulo Custodio", "y" : 2, - "drilldown" : "Paulo Custodio", - "name" : "Paulo Custodio" + "drilldown" : "Paulo Custodio" }, { "y" : 2, - "name" : "Peter Campbell Smith", - "drilldown" : "Peter Campbell Smith" + "drilldown" : "Peter Campbell Smith", + "name" : "Peter Campbell Smith" }, { - "name" : "Robert DiCicco", "drilldown" : "Robert DiCicco", - "y" : 1 + "y" : 1, + "name" : "Robert DiCicco" }, { "name" : "Roger Bell_West", - "drilldown" : "Roger Bell_West", - "y" : 5 + "y" : 5, + "drilldown" : "Roger Bell_West" }, { + "y" : 3, "drilldown" : "Simon Green", - "name" : "Simon Green", - "y" : 3 + "name" : "Simon Green" }, { - "y" : 1, "drilldown" : "Steven Wilson", + "y" : 1, "name" : "Steven Wilson" }, { - "y" : 4, "name" : "Ulrich Rieke", + "y" : 4, "drilldown" : "Ulrich Rieke" }, { + "name" : "W. Luis Mochan", "y" : 3, - "drilldown" : "W. Luis Mochan", - "name" : "W. Luis Mochan" + "drilldown" : "W. Luis Mochan" } - ], - "colorByPoint" : 1 + ] } ], + "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 + }, "yAxis" : { "title" : { "text" : "Total Solutions" } }, - "legend" : { - "enabled" : 0 + "title" : { + "text" : "The Weekly Challenge - 139" + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + }, + "borderWidth" : 0 + } + }, + "xAxis" : { + "type" : "category" }, "chart" : { "type" : "column" + }, + "subtitle" : { + "text" : "[Champions: 25] Last updated at 2021-11-20 09:52:59 GMT" } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 5a61cfc256..965bf50487 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,30 +1,31 @@ { + "yAxis" : { + "title" : { + "text" : null + }, + "min" : 0 + }, "title" : { "text" : "The Weekly Challenge Contributions [2019 - 2021]" }, - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" - }, - "xAxis" : { - "type" : "category", - "labels" : { - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - } - } - }, - "subtitle" : { - "text" : "Last updated at 2021-11-20 08:31:55 GMT" - }, - "chart" : { - "type" : "column" - }, "legend" : { "enabled" : "false" }, "series" : [ { + "dataLabels" : { + "align" : "right", + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + }, + "format" : "{point.y:.0f}", + "color" : "#FFFFFF", + "y" : 10, + "rotation" : -90, + "enabled" : "true" + }, + "name" : "Contributions", "data" : [ [ "Blog", @@ -32,32 +33,31 @@ ], [ "Perl", - 6679 + 6680 ], [ "Raku", - 4037 + 4038 ] - ], - "name" : "Contributions", - "dataLabels" : { - "y" : 10, - "enabled" : "true", - "color" : "#FFFFFF", - "rotation" : -90, - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - }, - "align" : "right", - "format" : "{point.y:.0f}" - } + ] } ], - "yAxis" : { - "title" : { - "text" : null + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" + }, + "chart" : { + "type" : "column" + }, + "subtitle" : { + "text" : "Last updated at 2021-11-20 09:52:58 GMT" + }, + "xAxis" : { + "labels" : { + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + } }, - "min" : 0 + "type" : "category" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index c4142aa744..fd6f87dac5 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,30 +1,8 @@ { - "xAxis" : { - "type" : "category" - }, - "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>" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } - } - }, - "title" : { - "text" : "The Weekly Challenge Language" - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2021-11-20 08:31:55 GMT" - }, "drilldown" : { "series" : [ { + "id" : "001", "data" : [ [ "Perl", @@ -39,12 +17,9 @@ 11 ] ], - "name" : "001", - "id" : "001" + "name" : "001" }, { - "id" : "002", - "name" : "002", "data" : [ [ "Perl", @@ -58,10 +33,11 @@ "Blog", 10 ] - ] + ], + "name" : "002", + "id" : "002" }, { - "name" : "003", "data" : [ [ "Perl", @@ -76,10 +52,12 @@ 9 ] ], + "name" : "003", "id" : "003" }, { "id" : "004", + "name" : "004", "data" : [ [ "Perl", @@ -93,11 +71,11 @@ "Blog", 10 ] - ], - "name" : "004" + ] }, { "id" : "005", + "name" : "005", "data" : [ [ "Perl", @@ -111,8 +89,7 @@ "Blog", 12 ] - ], - "name" : "005" + ] }, { "id" : "006", @@ -133,7 +110,7 @@ ] }, { - "name" : "007", + "id" : "007", "data" : [ [ "Perl", @@ -148,11 +125,9 @@ 10 ] ], - "id" : "007" + "name" : "007" }, { - "id" : "008", - "name" : "008", "data" : [ [ "Perl", @@ -166,7 +141,9 @@ "Blog", 12 ] - ] + ], + "name" : "008", + "id" : "008" }, { "data" : [ @@ -187,7 +164,7 @@ "id" : "009" }, { - "name" : "010", + "id" : "010", "data" : [ [ "Perl", @@ -202,7 +179,7 @@ 11 ] ], - "id" : "010" + "name" : "010" }, { "id" : "011", @@ -223,7 +200,7 @@ ] }, { - "name" : "012", + "id" : "012", "data" : [ [ "Perl", @@ -238,10 +215,9 @@ 11 ] ], - "id" : "012" + "name" : "012" }, { - "id" : "013", "name" : "013", "data" : [ [ @@ -256,9 +232,11 @@ "Blog", 13 ] - ] + ], + "id" : "013" }, { + "id" : "014", "name" : "014", "data" : [ [ @@ -273,10 +251,10 @@ "Blog", 15 ] - ], - "id" : "014" + ] }, { + "id" : "015", "data" : [ [ "Perl", @@ -291,10 +269,11 @@ 15 ] ], - "name" : "015", - "id" : "015" + "name" : "015" }, { + "id" : "016", + "name" : "016", "data" : [ [ "Perl", @@ -308,9 +287,7 @@ "Blog", 12 ] - ], - "name" : "016", - "id" : "016" + ] }, { "name" : "017", @@ -331,7 +308,6 @@ "id" : "017" }, { - "id" : "018", "data" : [ [ "Perl", @@ -346,11 +322,10 @@ 14 ] ], - "name" : "018" + "name" : "018", + "id" : "018" }, { - "id" : "019", - "name" : "019", "data" : [ [ "Perl", @@ -364,10 +339,11 @@ "Blog", 13 ] - ] + ], + "name" : "019", + "id" : "019" }, { - "name" : "020", "data" : [ [ "Perl", @@ -382,10 +358,11 @@ 13 ] ], + "name" : "020", "id" : "020" }, { - "id" : "021", + "name" : "021", "data" : [ [ "Perl", @@ -400,7 +377,7 @@ 10 ] ], - "name" : "021" + "id" : "021" }, { "name" : "022", @@ -421,7 +398,6 @@ "id" : "022" }, { - "id" : "023", "name" : "023", "data" : [ [ @@ -436,7 +412,8 @@ "Blog", 12 ] - ] + ], + "id" : "023" }, { "name" : "024", @@ -457,7 +434,7 @@ "id" : "024" }, { - "id" : "025", + "name" : "025", "data" : [ [ "Perl", @@ -472,9 +449,10 @@ 12 ] ], - "name" : "025" + "id" : "025" }, { + "id" : "026", "data" : [ [ "Perl", @@ -489,11 +467,10 @@ 10 ] ], - "name" : "026", - "id" : "026" + "name" : "026" }, { - "id" : "027", + "name" : "027", "data" : [ [ "Perl", @@ -508,11 +485,10 @@ 9 ] ], - "name" : "027" + "id" : "027" }, { "id" : "028", - "name" : "028", "data" : [ [ "Perl", @@ -526,10 +502,10 @@ "Blog", 9 ] - ] + ], + "name" : "028" }, { - "name" : "029", "data" : [ [ "Perl", @@ -544,11 +520,11 @@ 12 ] ], + "name" : "029", "id" : "029" }, { "id" : "030", - "name" : "030", "data" : [ [ "Perl", @@ -562,7 +538,8 @@ "Blog", 10 ] - ] + ], + "name" : "030" }, { "id" : "031", @@ -583,6 +560,7 @@ "name" : "031" }, { + "id" : "032", "data" : [ [ "Perl", @@ -597,12 +575,9 @@ 10 ] ], - "name" : "032", - "id" : "032" + "name" : "032" }, { - "id" : "033", - "name" : "033", "data" : [ [ "Perl", @@ -616,7 +591,9 @@ "Blog", 10 ] - ] + ], + "name" : "033", + "id" : "033" }, { "data" : [ @@ -637,7 +614,6 @@ "id" : "034" |
