diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2019-05-30 11:43:25 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2019-05-30 11:43:25 +0100 |
| commit | 9044249712c9391dd23ca1b5d8680871b4860080 (patch) | |
| tree | 3a445da58cf8e8864f5fbbcd1417e3ff1df6be47 | |
| parent | 5313819f0257e3bfacaf5f237ec30c907a00d4d5 (diff) | |
| download | perlweeklychallenge-club-9044249712c9391dd23ca1b5d8680871b4860080.tar.gz perlweeklychallenge-club-9044249712c9391dd23ca1b5d8680871b4860080.tar.bz2 perlweeklychallenge-club-9044249712c9391dd23ca1b5d8680871b4860080.zip | |
- Added solution by Maxim Nechaev.
| -rw-r--r-- | challenge-010/maxim-nechaev/perl5/ch-1.pl | 51 | ||||
| -rw-r--r-- | stats/pwc-current.json | 109 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 56 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 198 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 472 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 102 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 104 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 36 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 220 |
9 files changed, 707 insertions, 641 deletions
diff --git a/challenge-010/maxim-nechaev/perl5/ch-1.pl b/challenge-010/maxim-nechaev/perl5/ch-1.pl new file mode 100644 index 0000000000..8f522858eb --- /dev/null +++ b/challenge-010/maxim-nechaev/perl5/ch-1.pl @@ -0,0 +1,51 @@ +#!/usr/bin/perl -w +use strict; +use feature 'say'; +use List::Util qw/first/; + +sub lat2dec { + my %l = ( + I => 1, + V => 5, + X => 10, + L => 50, + C => 100, + D => 500, + M => 1000, + ); + + my ($n, $p) = (0, 0); + for ( reverse split '', shift ) { + $n += $p <= $l{$_}? $l{$_} : -$l{$_}; + $p = $l{$_}; + } + return $n; +} + +sub dec2lat { + my %d = ( + 1 => 'I', + 4 => 'IV', + 5 => 'V', + 9 => 'IX', + 10 => 'X', + 40 => 'XL', + 50 => 'L', + 90 => 'XC', + 100 => 'C', + 400 => 'CD', + 500 => 'D', + 900 => 'CM', + 1000 => 'M', + ); + + my ($n, $s, $v) = (shift, '', 0); + do { + $v = first { $n >= $_ } sort { $b <=> $a } keys %d; + $s .= $d{$v}; + } while $n -= $v; + return $s; +} + +say lat2dec('MCMXCIV'); # 1994 +say dec2lat(2019); # MMXIX diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 34f832623f..2bac6f3963 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,46 +1,26 @@ { - "subtitle" : { - "text" : "[Champions: 5] Last updated at 2019-05-29 16:27:37 GMT" - }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - }, - "borderWidth" : 0 - } - }, - "chart" : { - "type" : "column" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "tooltip" : { - "pointerFormat" : "<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" : [ { "data" : [ { - "drilldown" : "Daniel Mita", "name" : "Daniel Mita", + "drilldown" : "Daniel Mita", "y" : 1 }, { + "y" : 1, "drilldown" : "Donald Hunter", - "name" : "Donald Hunter", - "y" : 1 + "name" : "Donald Hunter" }, { "y" : 1, - "drilldown" : "Kivanc Yazan", - "name" : "Kivanc Yazan" + "name" : "Kivanc Yazan", + "drilldown" : "Kivanc Yazan" + }, + { + "drilldown" : "Maxim Nechaev", + "name" : "Maxim Nechaev", + "y" : 1 }, { "y" : 1, @@ -48,21 +28,15 @@ "drilldown" : "Pavel Jurca" }, { - "y" : 1, + "name" : "Simon Proctor", "drilldown" : "Simon Proctor", - "name" : "Simon Proctor" + "y" : 1 } ], "name" : "Champions", "colorByPoint" : 1 } ], - "legend" : { - "enabled" : 0 - }, - "xAxis" : { - "type" : "category" - }, "drilldown" : { "series" : [ { @@ -72,28 +46,38 @@ 1 ] ], - "id" : "Daniel Mita", - "name" : "Daniel Mita" + "name" : "Daniel Mita", + "id" : "Daniel Mita" }, { + "id" : "Donald Hunter", "data" : [ [ "Perl 6", 1 ] ], - "name" : "Donald Hunter", - "id" : "Donald Hunter" + "name" : "Donald Hunter" }, { - "id" : "Kivanc Yazan", + "data" : [ + [ + "Perl 5", + 1 + ] + ], "name" : "Kivanc Yazan", + "id" : "Kivanc Yazan" + }, + { "data" : [ [ "Perl 5", 1 ] - ] + ], + "name" : "Maxim Nechaev", + "id" : "Maxim Nechaev" }, { "id" : "Pavel Jurca", @@ -106,18 +90,49 @@ ] }, { + "id" : "Simon Proctor", + "name" : "Simon Proctor", "data" : [ [ "Perl 6", 1 ] - ], - "name" : "Simon Proctor", - "id" : "Simon Proctor" + ] } ] }, + "subtitle" : { + "text" : "[Champions: 6] Last updated at 2019-05-30 10:41:38 GMT" + }, "title" : { "text" : "Perl Weekly Challenge - 010" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "tooltip" : { + "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>", + "followPointer" : 1, + "pointerFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>" + }, + "legend" : { + "enabled" : 0 + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + }, + "borderWidth" : 0 + } + }, + "xAxis" : { + "type" : "category" + }, + "chart" : { + "type" : "column" } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index ed26d58016..ca085522a6 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,26 +1,42 @@ { + "subtitle" : { + "text" : "Last updated at 2019-05-30 10:41:48 GMT" + }, + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" + }, "xAxis" : { - "type" : "category", "labels" : { "style" : { "fontFamily" : "Verdana, sans-serif", "fontSize" : "13px" } + }, + "type" : "category" + }, + "yAxis" : { + "min" : 0, + "title" : { + "text" : null } }, "series" : [ { + "name" : "Contributions", "dataLabels" : { + "y" : 10, + "enabled" : "true", + "rotation" : -90, "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" }, - "color" : "#FFFFFF", "format" : "{point.y:.0f}", - "enabled" : "true", - "y" : 10, - "rotation" : -90, - "align" : "right" + "align" : "right", + "color" : "#FFFFFF" }, "data" : [ [ @@ -29,35 +45,19 @@ ], [ "Perl 5", - 374 + 375 ], [ "Perl 6", 221 ] - ], - "name" : "Contributions" + ] } ], - "yAxis" : { - "min" : 0, - "title" : { - "text" : null - } - }, - "subtitle" : { - "text" : "Last updated at 2019-05-29 16:27:52 GMT" - }, - "title" : { - "text" : "Contribution Summary" - }, "legend" : { "enabled" : "false" }, - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" - }, - "chart" : { - "type" : "column" + "title" : { + "text" : "Contribution Summary" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index a10fd6ba99..989c1027c7 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,7 +1,93 @@ { + "xAxis" : { + "type" : "category" + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + }, + "borderWidth" : 0 + } + }, + "tooltip" : { + "headerFormat" : "<span style=\"font-size:11px\"></span>", + "followPointer" : "true", + "pointFormat" : "<span style=\"color:{point.color}\">{point.name}</span>: <b>{point.y:f}</b><br/>" + }, + "series" : [ + { + "name" : "Perl Weekly Challenge Languages", + "colorByPoint" : "true", + "data" : [ + { + "drilldown" : "001", + "name" : "#001 [P5=76 P6=37]", + "y" : 113 + }, + { + "y" : 95, + "drilldown" : "002", + "name" : "#002 [P5=63 P6=32]" + }, + { + "y" : 58, + "drilldown" : "003", + "name" : "#003 [P5=32 P6=26]" + }, + { + "y" : 75, + "drilldown" : "004", + "name" : "#004 [P5=46 P6=29]" + }, + { + "drilldown" : "005", + "name" : "#005 [P5=33 P6=22]", + "y" : 55 + }, + { + "drilldown" : "006", + "name" : "#006 [P5=27 P6=14]", + "y" : 41 + }, + { + "y" : 46, + "drilldown" : "007", + "name" : "#007 [P5=26 P6=20]" + }, + { + "y" : 56, + "drilldown" : "008", + "name" : "#008 [P5=36 P6=20]" + }, + { + "name" : "#009 [P5=33 P6=18]", + "drilldown" : "009", + "y" : 51 + }, + { + "y" : 6, + "drilldown" : "010", + "name" : "#010 [P5=3 P6=3]" + } + ] + } + ], + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "title" : { + "text" : "Perl Weekly Challenge Language" + }, "legend" : { "enabled" : "false" }, + "subtitle" : { + "text" : "Click the columns to drilldown the language breakdown. Last updated at 2019-05-30 10:41:48 GMT" + }, "drilldown" : { "series" : [ { @@ -29,10 +115,11 @@ 32 ] ], - "name" : "002", - "id" : "002" + "id" : "002", + "name" : "002" }, { + "id" : "003", "data" : [ [ "Perl 5", @@ -43,12 +130,9 @@ 26 ] ], - "name" : "003", - "id" : "003" + "name" : "003" }, { - "id" : "004", - "name" : "004", "data" : [ [ "Perl 5", @@ -58,9 +142,12 @@ "Perl 6", 29 ] - ] + ], + "id" : "004", + "name" : "004" }, { + "id" : "005", "data" : [ [ "Perl 5", @@ -71,7 +158,6 @@ 22 ] ], - "id" : "005", "name" : "005" }, { @@ -89,8 +175,8 @@ "name" : "006" }, { - "id" : "007", "name" : "007", + "id" : "007", "data" : [ [ "Perl 5", @@ -103,6 +189,7 @@ ] }, { + "name" : "008", "data" : [ [ "Perl 5", @@ -113,7 +200,6 @@ 20 ] ], - "name" : "008", "id" : "008" }, { @@ -131,108 +217,22 @@ ] }, { + "id" : "010", "data" : [ [ "Perl 5", - 2 + 3 ], [ "Perl 6", 3 ] ], - "name" : "010", - "id" : "010" + "name" : "010" } ] }, "chart" : { "type" : "column" - }, - "tooltip" : { - "followPointer" : "true", - "headerFormat" : "<span style=\"font-size:11px\"></span>", - "pointFormat" : "<span style=\"color:{point.color}\">{point.name}</span>: <b>{point.y:f}</b><br/>" - }, - "xAxis" : { - "type" : "category" - }, - "title" : { - "text" : "Perl Weekly Challenge Language" - }, - "series" : [ - { - "data" : [ - { - "y" : 113, - "drilldown" : "001", - "name" : "#001 [P5=76 P6=37]" - }, - { - "name" : "#002 [P5=63 P6=32]", - "drilldown" : "002", - "y" : 95 - }, - { - "y" : 58, - "drilldown" : "003", - "name" : "#003 [P5=32 P6=26]" - }, - { - "name" : "#004 [P5=46 P6=29]", - "y" : 75, - "drilldown" : "004" - }, - { - "drilldown" : "005", - "y" : 55, - "name" : "#005 [P5=33 P6=22]" - }, - { - "drilldown" : "006", - "y" : 41, - "name" : "#006 [P5=27 P6=14]" - }, - { - "name" : "#007 [P5=26 P6=20]", - "drilldown" : "007", - "y" : 46 - }, - { - "y" : 56, - "drilldown" : "008", - "name" : "#008 [P5=36 P6=20]" - }, - { - "y" : 51, - "drilldown" : "009", - "name" : "#009 [P5=33 P6=18]" - }, - { - "drilldown" : "010", - "y" : 5, - "name" : "#010 [P5=2 P6=3]" - } - ], - "colorByPoint" : "true", - "name" : "Perl Weekly Challenge Languages" - } - ], - "plotOptions" : { - "series" : { - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - }, - "borderWidth" : 0 - } - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2019-05-29 16:27:52 GMT" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } } } diff --git a/stats/pwc-leaders.json b/stats/pwc-leaders.json index edaa1f81d0..b8e6c95b59 100644 --- a/stats/pwc-leaders.json +++ b/stats/pwc-leaders.json @@ -1,49 +1,36 @@ { - "tooltip" : { - "followPointer" : "true", - "pointFormat" : "<span style=\"color:{point.color}\">{point.name}</span>: <b>{point.y:f}</b><br/>", - "headerFormat" : "<span style=\"font-size:11px\"></span>" - }, - "legend" : { - "enabled" : "false" - }, - "yAxis" : { - "title" : { - "text" : "Total Score" - } - }, "drilldown" : { "series" : [ { - "id" : "Laurent Rosenfeld", "name" : "Laurent Rosenfeld", "data" : [ [ - "Perl 6", - 17 - ], - [ "Perl 5", 18 ], [ "Blog", 11 + ], + [ + "Perl 6", + 17 ] - ] + ], + "id" : "Laurent Rosenfeld" }, { "name" : "Joelle Maslak", "data" : [ [ - "Blog", - 2 - ], - [ "Perl 5", 20 ], [ + "Blog", + 2 + ], + [ "Perl 6", 20 ] @@ -54,11 +41,11 @@ "id" : "Jaldhar H. Vyas", "data" : [ [ - "Perl 5", + "Perl 6", 18 ], [ - "Perl 6", + "Perl 5", 18 ] ], @@ -68,17 +55,18 @@ "id" : "Ruben Westerberg", "data" : [ [ - "Perl 5", + "Perl 6", 16 ], [ - "Perl 6", + "Perl 5", 16 ] ], "name" : "Ruben Westerberg" }, { + "name" : "Adam Russell", "data" : [ [ "Perl 5", @@ -89,30 +77,28 @@ 9 ] ], - "name" : "Adam Russell", "id" : "Adam Russell" }, { - "id" : "Simon Proctor", "name" : "Simon Proctor", "data" : [ [ - "Perl 5", - 4 - ], - [ "Perl 6", 16 ], [ + "Perl 5", + 4 + ], + [ "Blog", 6 ] - ] + ], + "id" : "Simon Proctor" }, { "id" : "Arne Sommer", - "name" : "Arne Sommer", "data" : [ [ "Blog", @@ -122,7 +108,8 @@ "Perl 6", 16 ] - ] + ], + "name" : "Arne Sommer" }, { "data" : [ @@ -139,38 +126,39 @@ "id" : "Kian-Meng Ang" }, { + "id" : "Dr James A. Smith", "data" : [ [ - "Perl 5", - 12 - ], - [ "Perl 6", 10 + ], + [ + "Perl 5", + 12 ] ], - "name" : "Dr James A. Smith", - "id" : "Dr James A. Smith" + "name" : "Dr James A. Smith" }, { - "id" : "Jo Christian Oterhals", - "name" : "Jo Christian Oterhals", "data" : [ [ + "Perl 6", + 10 + ], + [ "Blog", 5 ], [ "Perl 5", 6 - ], - [ - "Perl 6", - 10 ] - ] + ], + "name" : "Jo Christian Oterhals", + "id" : "Jo Christian Oterhals" }, { + "name" : "Gustavo Chaves", "data" : [ [ "Blog", @@ -181,7 +169,6 @@ 15 ] ], - "name" : "Gustavo Chaves", "id" : "Gustavo Chaves" }, { @@ -205,44 +192,44 @@ ] }, { - "id" : "Francis Whittle", "name" : "Francis Whittle", "data" : [ [ - "Perl 6", - 12 - ], - [ "Blog", 5 + ], + [ + "Perl 6", + 12 ] - ] + ], + "id" : "Francis Whittle" }, { + "id" : "Nick Logan", "data" : [ [ - "Perl 6", + "Perl 5", 8 ], [ - "Perl 5", + "Perl 6", 8 ] ], - "name" : "Nick Logan", - "id" : "Nick Logan" + "name" : "Nick Logan" }, { "id" : "Dave Jacoby", "name" : "Dave Jacoby", "data" : [ [ - "Perl 5", - 7 - ], - [ "Blog", 8 + ], + [ + "Perl 5", + 7 ] ] }, @@ -261,6 +248,7 @@ "id" : "E. Choroba" }, { + "name" : "Lars Balker", "data" : [ [ "Perl 5", @@ -271,7 +259,6 @@ 4 ] ], - "name" : "Lars Balker", "id" : "Lars Balker" }, { @@ -285,18 +272,18 @@ "name" : "Daniel Mantovani" }, { + "id" : "Mark Senn", + "name" : "Mark Senn", "data" : [ [ - "Blog", - 3 - ], - [ "Perl 6", 10 + ], + [ + "Blog", + 3 ] - ], - "name" : "Mark Senn", - "id" : "Mark Senn" + ] }, { "data" : [ @@ -310,67 +297,67 @@ }, { "id" : "Duncan C. White", + "name" : "Duncan C. White", "data" : [ [ "Perl 5", 10 ] - ], - "name" : "Duncan C. White" + ] }, { + "id" : "Robert Gratza", "name" : "Robert Gratza", "data" : [ [ - "Perl 5", - 2 - ], - [ "Perl 6", 6 + ], + [ + "Perl 5", + 2 ] - ], - "id" : "Robert Gratza" + ] }, { + "id" : "Guillermo Ramos", "name" : "Guillermo Ramos", "data" : [ [ "Perl 5", 7 ] - ], - "id" : "Guillermo Ramos" + ] }, { + "id" : "John Barrett", "name" : "John Barrett", "data" : [ [ "Perl 5", 7 ] - ], - "id" : "John Barrett" + ] }, { - "name" : "Ozzy", + "id" : "Maxim Nechaev", "data" : [ [ - "Perl 6", + "Perl 5", 7 ] ], - "id" : "Ozzy" + "name" : "Maxim Nechaev" }, { - "id" : "Alicia Bielsa", + "id" : "Ozzy", "data" : [ [ - "Perl 5", - 6 + "Perl 6", + 7 ] ], - "name" : "Alicia Bielsa" + "name" : "Ozzy" }, { "data" : [ @@ -379,52 +366,52 @@ 6 ] ], - "name" : "Maxim Kolodyazhny", - "id" : "Maxim Kolodyazhny" + "name" : "Alicia Bielsa", + "id" : "Alicia Bielsa" }, { - "name" : "Maxim Nechaev", + "id" : "Maxim Kolodyazhny", "data" : [ [ "Perl 5", 6 ] ], - "id" : "Maxim Nechaev" + "name" : "Maxim Kolodyazhny" }, { - "id" : "Philippe Bruhat", + "name" : "Philippe Bruhat", "data" : [ [ - "Blog", - 2 - ], - [ "Perl 5", 4 + ], + [ + "Blog", + 2 ] ], - "name" : "Philippe Bruhat" + "id" : "Philippe Bruhat" }, { + "id" : "Sergio Iglesias", + "name" : "Sergio Iglesias", "data" : [ [ "Perl 5", 6 ] - ], - "name" : "Sergio Iglesias", - "id" : "Sergio Iglesias" + ] }, { "id" : "Steven Wilson", - "name" : "Steven Wilson", "data" : [ [ "Perl 5", 6 ] - ] + ], + "name" : "Steven Wilson" }, { "name" : "Arpad Toth", @@ -437,96 +424,96 @@ "id" : "Arpad Toth" }, { - "id" : "Khalid", "name" : "Khalid", "data" : [ [ - "Blog", - 1 - ], - [ "Perl 5", 4 + ], + [ + "Blog", + 1 ] - ] + ], + "id" : "Khalid" }, { "id" : "Steve Rogerson", "data" : [ [ - "Perl 6", - 2 - ], - [ "Perl 5", 3 + ], + [ + "Perl 6", + 2 ] ], "name" : "Steve Rogerson" }, { - "id" : "Veesh Goldman", - "name" : "Veesh Goldman", "data" : [ [ "Perl 5", 5 ] - ] + ], + "name" : "Veesh Goldman", + "id" : "Veesh Goldman" }, { - "id" : "Yozen Hernandez", + "name" : "Yozen Hernandez", "data" : [ [ - "Blog", - 1 - ], - [ "Perl 5", 4 + ], + [ + "Blog", + 1 ] ], - "name" : "Yozen Hernandez" + "id" : "Yozen Hernandez" }, { - "id" : "Alex Daniel", + "name" : "Alex Daniel", "data" : [ [ "Perl 6", 4 ] ], - "name" : "Alex Daniel" + "id" : "Alex Daniel" }, { - "name" : "Bob Kleemann", + "id" : "Bob Kleemann", "data" : [ [ "Perl 5", 4 ] ], |
