From b000e02c450ca4cbeb7683502a6918d38215eeca Mon Sep 17 00:00:00 2001 From: Simon Proctor Date: Mon, 29 Apr 2019 14:22:32 +0100 Subject: Challenge 1 --- challenge-006/simon-proctor/perl6/ch-1.p6 | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 challenge-006/simon-proctor/perl6/ch-1.p6 diff --git a/challenge-006/simon-proctor/perl6/ch-1.p6 b/challenge-006/simon-proctor/perl6/ch-1.p6 new file mode 100755 index 0000000000..35a2cb9691 --- /dev/null +++ b/challenge-006/simon-proctor/perl6/ch-1.p6 @@ -0,0 +1,54 @@ +#!/usr/bin/env perl6 + +use v6; + +role GrowableRange { + has Int $.min; + has Int $.max; + + submethod BUILD( Int :$!min, Int :$!max ) {} + + method next() { $!max + 1 } + + method grow() { $!max++; return self } + + method gist() { $!min == $!max ?? $!min.Str !! "{$!min}-{$!max}" } + + method Str() { self.gist } +} + +sub USAGE { say $*USAGE } + +#| Display Help file +multi sub MAIN ( Bool :h($help) where *.so ) { USAGE(); } + +#| Get the shortend list of a CSV string +multi sub MAIN ( + Str $number-string where * ~~ /^ \d+ [ ',' \d+ ]* $/ #= Comma seperated list of numbers +) { + my Int @in = [$_.Int for $number-string.split(",")].sort( * <=> * ); + say process-list( @in ); +} + +#| Get the shorted list of a space seperated list of number +multi sub MAIN ( + *@numbers where { all($_) ~~ IntStr } #= List of integers +) { + my Int @in = [$_.Int for @numbers].sort( * <=> * ); + say process-list( @in ); +} + +sub process-list( Int @numbers ) { + my $current; + my @out; + + for @numbers -> $number { + if @out.elems == 0 || @out[*-1].next != $number { + @out.push( GrowableRange.new( min => $number, max => $number ) ); + } else { + @out[*-1].grow; + } + } + + return @out.join(","); +} -- cgit From 17403fe9f2423fea312e57b752ee465ee2ff6931 Mon Sep 17 00:00:00 2001 From: Simon Proctor Date: Mon, 29 Apr 2019 15:16:32 +0100 Subject: Make it a class --- challenge-006/simon-proctor/perl6/ch-1.p6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenge-006/simon-proctor/perl6/ch-1.p6 b/challenge-006/simon-proctor/perl6/ch-1.p6 index 35a2cb9691..00dca1a540 100755 --- a/challenge-006/simon-proctor/perl6/ch-1.p6 +++ b/challenge-006/simon-proctor/perl6/ch-1.p6 @@ -2,7 +2,7 @@ use v6; -role GrowableRange { +class GrowableRange { has Int $.min; has Int $.max; -- cgit From 26de01e69ab0409eecd7d2b84d9986d82a782439 Mon Sep 17 00:00:00 2001 From: "Gustavo L. de M. Chaves" Date: Tue, 30 Apr 2019 22:33:28 -0300 Subject: Gustavo Chaves's perl5 solutions to challenge 006 --- challenge-006/gustavo-chaves/perl5/ch-1.pl | 24 ++++++++++++++++++++++++ challenge-006/gustavo-chaves/perl5/ch-2.pl | 12 ++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 challenge-006/gustavo-chaves/perl5/ch-1.pl create mode 100755 challenge-006/gustavo-chaves/perl5/ch-2.pl diff --git a/challenge-006/gustavo-chaves/perl5/ch-1.pl b/challenge-006/gustavo-chaves/perl5/ch-1.pl new file mode 100755 index 0000000000..6a50d993ba --- /dev/null +++ b/challenge-006/gustavo-chaves/perl5/ch-1.pl @@ -0,0 +1,24 @@ +#!/usr/bin/env perl + +# Create a script which takes a list of numbers from command line and print the +# same in the compact form. For example, if you pass “1,2,3,4,9,10,14,15,16” +# then it should print the compact form like “1-4,9,10,14-16”. + +use strict; +use warnings; + +# The script should be invoked with a single argument which is a comma-separated +# list of integers in ascending order. + +my ($from, @list) = split /,/, shift; +my $to = $from; + +foreach my $n (@list) { + if ($n > $to + 1) { + print $from == $to ? "$to," : "$from-$to,"; + $from = $n; + } + $to = $n; +} + +print $from == $to ? "$to\n" : "$from-$to\n"; diff --git a/challenge-006/gustavo-chaves/perl5/ch-2.pl b/challenge-006/gustavo-chaves/perl5/ch-2.pl new file mode 100755 index 0000000000..e55d1e5919 --- /dev/null +++ b/challenge-006/gustavo-chaves/perl5/ch-2.pl @@ -0,0 +1,12 @@ +#!/usr/bin/env perl + +# Create a script to calculate Ramanujan’s constant with at least 32 digits of +# precision. Find out more about it here: +# https://en.wikipedia.org/wiki/Heegner_number#Almost_integers_and_Ramanujan's_constant + +use 5.026; +use strict; +use warnings; +use bignum 'PI'; + +say PI()->bmul(sqrt(163))->bexp(32); -- cgit From db975fdc5292458acb5277082fb21c9faeeedeb5 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 30 Apr 2019 22:21:39 -0400 Subject: Add tim-smith/perl6/ch-1.p6 --- challenge-006/tim-smith/perl6/ch-1.p6 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 challenge-006/tim-smith/perl6/ch-1.p6 diff --git a/challenge-006/tim-smith/perl6/ch-1.p6 b/challenge-006/tim-smith/perl6/ch-1.p6 new file mode 100755 index 0000000000..506c8802e9 --- /dev/null +++ b/challenge-006/tim-smith/perl6/ch-1.p6 @@ -0,0 +1,21 @@ +#! /usr/bin/env perl6 + +# Comb all args for numbers, then flatten them into a single list of +# increasing integers +my @vals = @*ARGS».comb(/\d+/).Seq.flat».Int.sort.unique + or die "Usage: {$?FILE.IO.basename} 1 2,3 4/5/6 '7 8 9'"; + +my @groups; + +for @vals -> $n { + # Add a new group unless $n belongs in the current group + unless @groups and @groups.tail[1] == $n - 1 { + @groups.push: [$n, Nil]; + } + + # Update the endpoint of the current group + @groups.tail[1] = $n; +} + +# Display the groups +put @groups.map(*.unique.join('-')).join(','); -- cgit From 0c63db48073745086426393038efc5cb49f28435 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 30 Apr 2019 23:16:37 -0400 Subject: Add tim-smith/perl6/ch-2.p6 --- challenge-006/tim-smith/perl6/ch-2.p6 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 challenge-006/tim-smith/perl6/ch-2.p6 diff --git a/challenge-006/tim-smith/perl6/ch-2.p6 b/challenge-006/tim-smith/perl6/ch-2.p6 new file mode 100755 index 0000000000..73a74698c2 --- /dev/null +++ b/challenge-006/tim-smith/perl6/ch-2.p6 @@ -0,0 +1,12 @@ +#! /usr/bin/env perl6 + +# https://en.wikipedia.org/wiki/Heegner_number#Almost_integers_and_Ramanujan's_constant + +# Ramanujan's constant is _almost_ this integer ... +my $r = 640_320 ** 3 + 744; + +# But is off by an error which is defined in terms of the constant itself, +# so this approximation is close enough for at least 32 significant digits. +$r += FatRat.new: -196_844, $r; + +put substr($r, 0, 33); -- cgit From 011f8de58d776118b9cc682b6e171ed4d6e8b324 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Wed, 1 May 2019 11:37:16 +0100 Subject: - Added solutions by Scimon, Tim and Gustavo. --- stats/pwc-current.json | 109 +++-- stats/pwc-language-breakdown.json | 114 ++--- stats/pwc-leaders.json | 850 +++++++++++++++++++------------------- stats/pwc-summary-1-30.json | 86 ++-- stats/pwc-summary-31-60.json | 52 +-- stats/pwc-summary-61-90.json | 54 +-- stats/pwc-summary.json | 194 ++++----- 7 files changed, 752 insertions(+), 707 deletions(-) diff --git a/stats/pwc-current.json b/stats/pwc-current.json index f3922557ad..3dae4423d6 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,41 +1,37 @@ { - "tooltip" : { - "followPointer" : 1, - "headerFormat" : "{series.name}
", - "pointerFormat" : "{point.name}: {point.y:f}
" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "chart" : { - "type" : "column" - }, "series" : [ { - "name" : "Champions", - "colorByPoint" : 1, "data" : [ + { + "drilldown" : "Gustavo Chaves", + "y" : 2, + "name" : "Gustavo Chaves" + }, { "drilldown" : "Joelle Maslak", - "y" : 4, - "name" : "Joelle Maslak" + "name" : "Joelle Maslak", + "y" : 4 + }, + { + "drilldown" : "Simon Proctor", + "name" : "Simon Proctor", + "y" : 1 + }, + { + "drilldown" : "Tim Smith", + "name" : "Tim Smith", + "y" : 2 } - ] + ], + "name" : "Champions", + "colorByPoint" : 1 } ], - "plotOptions" : { - "series" : { - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - }, - "borderWidth" : 0 - } - }, "subtitle" : { - "text" : "[Champions: 1] Last updated at 2019-04-29 09:24:04 GMT" + "text" : "[Champions: 4] Last updated at 2019-05-01 10:34:44 GMT" + }, + "xAxis" : { + "type" : "category" }, "legend" : { "enabled" : 0 @@ -43,8 +39,18 @@ "drilldown" : { "series" : [ { - "id" : "Joelle Maslak", + "id" : "Gustavo Chaves", + "name" : "Gustavo Chaves", + "data" : [ + [ + "Perl 5", + 2 + ] + ] + }, + { "name" : "Joelle Maslak", + "id" : "Joelle Maslak", "data" : [ [ "Perl 5", @@ -55,13 +61,52 @@ 2 ] ] + }, + { + "name" : "Simon Proctor", + "id" : "Simon Proctor", + "data" : [ + [ + "Perl 6", + 1 + ] + ] + }, + { + "id" : "Tim Smith", + "name" : "Tim Smith", + "data" : [ + [ + "Perl 6", + 2 + ] + ] } ] }, + "tooltip" : { + "followPointer" : 1, + "pointerFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
" + }, + "chart" : { + "type" : "column" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + } + } + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, "title" : { "text" : "Perl Weekly Challenge - 006" - }, - "xAxis" : { - "type" : "category" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 8cc2f7f825..ad968205db 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,15 +1,11 @@ { - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "chart" : { - "type" : "column" + "xAxis" : { + "type" : "category" }, "drilldown" : { "series" : [ { + "id" : "001", "name" : "001", "data" : [ [ @@ -20,11 +16,11 @@ "Perl 6", 37 ] - ], - "id" : "001" + ] }, { "name" : "002", + "id" : "002", "data" : [ [ "Perl 5", @@ -34,11 +30,11 @@ "Perl 6", 32 ] - ], - "id" : "002" + ] }, { "name" : "003", + "id" : "003", "data" : [ [ "Perl 5", @@ -48,11 +44,11 @@ "Perl 6", 26 ] - ], - "id" : "003" + ] }, { "name" : "004", + "id" : "004", "data" : [ [ "Perl 5", @@ -62,10 +58,10 @@ "Perl 6", 29 ] - ], - "id" : "004" + ] }, { + "name" : "005", "id" : "005", "data" : [ [ @@ -76,72 +72,46 @@ "Perl 6", 22 ] - ], - "name" : "005" + ] }, { - "id" : "006", "name" : "006", + "id" : "006", "data" : [ [ "Perl 5", - 2 + 4 ], [ "Perl 6", - 2 + 5 ] ] } ] }, - "title" : { - "text" : "Perl Weekly Challenge Language" - }, - "tooltip" : { - "headerFormat" : "", - "pointFormat" : "{point.name}: {point.y:f}
", - "followPointer" : "true" - }, - "xAxis" : { - "type" : "category" - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2019-04-29 09:24:10 GMT" - }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, "series" : [ { - "name" : "Perl Weekly Challenge Languages", - "colorByPoint" : "true", "data" : [ { + "drilldown" : "001", "y" : 113, - "name" : "#001 [P5=76 P6=37]", - "drilldown" : "001" + "name" : "#001 [P5=76 P6=37]" }, { - "drilldown" : "002", + "name" : "#002 [P5=63 P6=32]", "y" : 95, - "name" : "#002 [P5=63 P6=32]" + "drilldown" : "002" }, { - "drilldown" : "003", + "name" : "#003 [P5=32 P6=26]", "y" : 58, - "name" : "#003 [P5=32 P6=26]" + "drilldown" : "003" }, { + "drilldown" : "004", "name" : "#004 [P5=46 P6=29]", - "y" : 75, - "drilldown" : "004" + "y" : 75 }, { "name" : "#005 [P5=31 P6=22]", @@ -149,14 +119,44 @@ "drilldown" : "005" }, { - "drilldown" : "006", - "name" : "#006 [P5=2 P6=2]", - "y" : 4 + "name" : "#006 [P5=4 P6=5]", + "y" : 9, + "drilldown" : "006" } - ] + ], + "name" : "Perl Weekly Challenge Languages", + "colorByPoint" : "true" } ], + "title" : { + "text" : "Perl Weekly Challenge Language" + }, "legend" : { "enabled" : "false" + }, + "chart" : { + "type" : "column" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + } + } + }, + "subtitle" : { + "text" : "Click the columns to drilldown the language breakdown. Last updated at 2019-05-01 10:34:58 GMT" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "tooltip" : { + "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "", + "followPointer" : "true" } } diff --git a/stats/pwc-leaders.json b/stats/pwc-leaders.json index c961e7b2fe..6d75d9f0e3 100644 --- a/stats/pwc-leaders.json +++ b/stats/pwc-leaders.json @@ -1,32 +1,286 @@ { - "title" : { - "text" : "Perl Weekly Challenge Leaders (TOP 50)" + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } + }, + "subtitle" : { + "text" : "Click the columns to drilldown the score breakdown. Last updated at 2019-05-01 10:34:55 GMT" + }, + "chart" : { + "type" : "column" }, "tooltip" : { - "followPointer" : "true", "pointFormat" : "{point.name}: {point.y:f}
", + "followPointer" : "true", "headerFormat" : "" }, - "legend" : { - "enabled" : "false" - }, - "yAxis" : { - "title" : { - "text" : "Total Score" + "series" : [ + { + "name" : "Perl Weekly Challenge Leaders", + "data" : [ + { + "name" : "#1: Joelle Maslak", + "drilldown" : "Joelle Maslak", + "y" : 50 + }, + { + "y" : 48, + "drilldown" : "Laurent Rosenfeld", + "name" : "#2: Laurent Rosenfeld" + }, + { + "drilldown" : "Jaldhar H. Vyas", + "name" : "#3: Jaldhar H. Vyas", + "y" : 40 + }, + { + "name" : "#4: Simon Proctor", + "drilldown" : "Simon Proctor", + "y" : 38 + }, + { + "y" : 36, + "drilldown" : "Dr James A. Smith", + "name" : "#5: Dr James A. Smith" + }, + { + "y" : 36, + "drilldown" : "Jo Christian Oterhals", + "name" : "#6: Jo Christian Oterhals" + }, + { + "y" : 32, + "drilldown" : "Nick Logan", + "name" : "#7: Nick Logan" + }, + { + "name" : "#8: Ruben Westerberg", + "drilldown" : "Ruben Westerberg", + "y" : 32 + }, + { + "y" : 30, + "drilldown" : "Adam Russell", + "name" : "#9: Adam Russell" + }, + { + "y" : 28, + "name" : "#10: Lars Balker", + "drilldown" : "Lars Balker" + }, + { + "y" : 26, + "name" : "#11: Gustavo Chaves", + "drilldown" : "Gustavo Chaves" + }, + { + "drilldown" : "Mark Senn", + "name" : "#12: Mark Senn", + "y" : 26 + }, + { + "y" : 24, + "name" : "#13: Arne Sommer", + "drilldown" : "Arne Sommer" + }, + { + "y" : 24, + "drilldown" : "Kian-Meng Ang", + "name" : "#14: Kian-Meng Ang" + }, + { + "y" : 20, + "name" : "#15: Andrezgz", + "drilldown" : "Andrezgz" + }, + { + "y" : 20, + "drilldown" : "Athanasius", + "name" : "#16: Athanasius" + }, + { + "y" : 20, + "drilldown" : "Doug Schrag", + "name" : "#17: Doug Schrag" + }, + { + "drilldown" : "Francis Whittle", + "name" : "#18: Francis Whittle", + "y" : 18 + }, + { + "drilldown" : "Duncan C. White", + "name" : "#19: Duncan C. White", + "y" : 16 + }, + { + "y" : 16, + "name" : "#20: Robert Gratza", + "drilldown" : "Robert Gratza" + }, + { + "y" : 14, + "drilldown" : "John Barrett", + "name" : "#21: John Barrett" + }, + { + "name" : "#22: Daniel Mantovani", + "drilldown" : "Daniel Mantovani", + "y" : 12 + }, + { + "drilldown" : "Philippe Bruhat", + "name" : "#23: Philippe Bruhat", + "y" : 12 + }, + { + "y" : 12, + "name" : "#24: Sergio Iglesias", + "drilldown" : "Sergio Iglesias" + }, + { + "y" : 10, + "drilldown" : "Khalid", + "name" : "#25: Khalid" + }, + { + "y" : 10, + "drilldown" : "Steve Rogerson", + "name" : "#26: Steve Rogerson" + }, + { + "y" : 10, + "name" : "#27: Veesh Goldman", + "drilldown" : "Veesh Goldman" + }, + { + "y" : 8, + "name" : "#28: Alex Daniel", + "drilldown" : "Alex Daniel" + }, + { + "drilldown" : "Arpad Toth", + "name" : "#29: Arpad Toth", + "y" : 8 + }, + { + "drilldown" : "Bob Kleemann", + "name" : "#30: Bob Kleemann", + "y" : 8 + }, + { + "drilldown" : "Chenyf", + "name" : "#31: Chenyf", + "y" : 8 + }, + { + "y" : 8, + "drilldown" : "David Kayal", + "name" : "#32: David Kayal" + }, + { + "drilldown" : "Jaime Corchado", + "name" : "#33: Jaime Corchado", + "y" : 8 + }, + { + "y" : 8, + "drilldown" : "Matt Latusek", + "name" : "#34: Matt Latusek" + }, + { + "y" : 8, + "drilldown" : "Maxim Kolodyazhny", + "name" : "#35: Maxim Kolodyazhny" + }, + { + "y" : 8, + "name" : "#36: Ozzy", + "drilldown" : "Ozzy" + }, + { + "y" : 8, + "name" : "#37: Simon Reinhardt", + "drilldown" : "Simon Reinhardt" + }, + { + "drilldown" : "Steven Wilson", + "name" : "#38: Steven Wilson", + "y" : 8 + }, + { + "y" : 8, + "drilldown" : "Tim Smith", + "name" : "#39: Tim Smith" + }, + { + "drilldown" : "Ailbhe Tweedie", + "name" : "#40: Ailbhe Tweedie", + "y" : 6 + }, + { + "y" : 6, + "drilldown" : "Dave Cross", + "name" : "#41: Dave Cross" + }, + { + "name" : "#42: Dave Jacoby", + "drilldown" : "Dave Jacoby", + "y" : 6 + }, + { + "y" : 6, + "drilldown" : "E. Choroba", + "name" : "#43: E. Choroba" + }, + { + "drilldown" : "Freddie B", + "name" : "#44: Freddie B", + "y" : 6 + }, + { + "y" : 6, + "drilldown" : "Jeremy Carman", + "name" : "#45: Jeremy Carman" + }, + { + "drilldown" : "Kivanc Yazan", + "name" : "#46: Kivanc Yazan", + "y" : 6 + }, + { + "y" : 6, + "drilldown" : "Neil Bowers", + "name" : "#47: Neil Bowers" + }, + { + "y" : 6, + "name" : "#48: Pete Houston", + "drilldown" : "Pete Houston" + }, + { + "drilldown" : "Sean Meininger", + "name" : "#49: Sean Meininger", + "y" : 6 + }, + { + "drilldown" : "Abigail", + "name" : "#50: Abigail", + "y" : 4 + } + ], + "colorByPoint" : "true" } - }, - "chart" : { - "type" : "column" - }, + ], "drilldown" : { "series" : [ { - "name" : "Joelle Maslak", "data" : [ - [ - "Perl 6", - 12 - ], [ "Perl 5", 12 @@ -34,11 +288,17 @@ [ "Blog", 1 + ], + [ + "Perl 6", + 12 ] ], - "id" : "Joelle Maslak" + "id" : "Joelle Maslak", + "name" : "Joelle Maslak" }, { + "name" : "Laurent Rosenfeld", "data" : [ [ "Perl 5", @@ -53,10 +313,10 @@ 9 ] ], - "name" : "Laurent Rosenfeld", "id" : "Laurent Rosenfeld" }, { + "name" : "Jaldhar H. Vyas", "data" : [ [ "Perl 5", @@ -67,25 +327,29 @@ 10 ] ], - "name" : "Jaldhar H. Vyas", "id" : "Jaldhar H. Vyas" }, { - "id" : "Dr James A. Smith", + "name" : "Simon Proctor", "data" : [ [ "Perl 5", - 10 + 4 + ], + [ + "Blog", + 4 ], [ "Perl 6", - 8 + 11 ] ], - "name" : "Dr James A. Smith" + "id" : "Simon Proctor" }, { - "name" : "Jo Christian Oterhals", + "name" : "Dr James A. Smith", + "id" : "Dr James A. Smith", "data" : [ [ "Perl 6", @@ -93,62 +357,58 @@ ], [ "Perl 5", - 6 - ], - [ - "Blog", - 4 + 10 ] - ], - "id" : "Jo Christian Oterhals" + ] }, { - "name" : "Simon Proctor", + "name" : "Jo Christian Oterhals", "data" : [ [ - "Perl 6", - 10 + "Perl 5", + 6 ], [ - "Perl 5", - 4 + "Perl 6", + 8 ], [ "Blog", 4 ] ], - "id" : "Simon Proctor" + "id" : "Jo Christian Oterhals" }, { "name" : "Nick Logan", + "id" : "Nick Logan", "data" : [ [ - "Perl 6", + "Perl 5", 8 ], [ - "Perl 5", + "Perl 6", 8 ] - ], - "id" : "Nick Logan" + ] }, { + "name" : "Ruben Westerberg", + "id" : "Ruben Westerberg", "data" : [ [ - "Perl 6", + "Perl 5", 8 ], [ - "Perl 5", + "Perl 6", 8 ] - ], - "id" : "Ruben Westerberg", - "name" : "Ruben Westerberg" + ] }, { + "name" : "Adam Russell", "data" : [ [ "Perl 5", @@ -159,8 +419,7 @@ 5 ] ], - "id" : "Adam Russell", - "name" : "Adam Russell" + "id" : "Adam Russell" }, { "data" : [ @@ -177,70 +436,70 @@ "name" : "Lars Balker" }, { - "name" : "Mark Senn", + "id" : "Gustavo Chaves", "data" : [ [ - "Perl 6", - 10 + "Blog", + 4 ], [ - "Blog", - 3 + "Perl 5", + 9 ] ], - "id" : "Mark Senn" + "name" : "Gustavo Chaves" }, { - "id" : "Arne Sommer", + "id" : "Mark Senn", "data" : [ [ "Perl 6", - 8 + 10 ], [ "Blog", - 4 + 3 ] ], - "name" : "Arne Sommer" + "name" : "Mark Senn" }, { - "name" : "Kian-Meng Ang", + "name" : "Arne Sommer", + "id" : "Arne Sommer", "data" : [ [ "Blog", 4 ], [ - "Perl 5", + "Perl 6", 8 ] - ], - "id" : "Kian-Meng Ang" + ] }, { - "name" : "Gustavo Chaves", + "name" : "Kian-Meng Ang", + "id" : "Kian-Meng Ang", "data" : [ [ - "Blog", - 4 + "Perl 5", + 8 ], [ - "Perl 5", - 7 + "Blog", + 4 ] - ], - "id" : "Gustavo Chaves" + ] }, { - "name" : "Andrezgz", + "id" : "Andrezgz", "data" : [ [ "Perl 5", 10 ] ], - "id" : "Andrezgz" + "name" : "Andrezgz" }, { "data" : [ @@ -253,49 +512,49 @@ "name" : "Athanasius" }, { + "id" : "Doug Schrag", "data" : [ [ "Perl 6", 10 ] ], - "id" : "Doug Schrag", "name" : "Doug Schrag" }, { + "name" : "Francis Whittle", "id" : "Francis Whittle", "data" : [ - [ - "Blog", - 3 - ], [ "Perl 6", 6 + ], + [ + "Blog", + 3 ] - ], - "name" : "Francis Whittle" + ] }, { + "name" : "Duncan C. White", + "id" : "Duncan C. White", "data" : [ [ "Perl 5", 8 ] - ], - "id" : "Duncan C. White", - "name" : "Duncan C. White" + ] }, { "name" : "Robert Gratza", "data" : [ - [ - "Perl 5", - 2 - ], [ "Perl 6", 6 + ], + [ + "Perl 5", + 2 ] ], "id" : "Robert Gratza" @@ -307,20 +566,21 @@ 7 ] ], - "name" : "John Barrett", - "id" : "John Barrett" + "id" : "John Barrett", + "name" : "John Barrett" }, { "name" : "Daniel Mantovani", + "id" : "Daniel Mantovani", "data" : [ [ "Perl 5", 6 ] - ], - "id" : "Daniel Mantovani" + ] }, { + "name" : "Philippe Bruhat", "data" : [ [ "Blog", @@ -331,21 +591,21 @@ 4 ] ], - "name" : "Philippe Bruhat", "id" : "Philippe Bruhat" }, { - "id" : "Sergio Iglesias", + "name" : "Sergio Iglesias", "data" : [ [ "Perl 5", 6 ] ], - "name" : "Sergio Iglesias" + "id" : "Sergio Iglesias" }, { "name" : "Khalid", + "id" : "Khalid", "data" : [ [ "Perl 5", @@ -355,52 +615,51 @@ "Blog", 1 ] - ], - "id" : "Khalid" + ] }, { - "id" : "Steve Rogerson", "data" : [ - [ - "Perl 5", - 3 - ], [ "Perl 6", 2 + ], + [ + "Perl 5", + 3 ] ], + "id" : "Steve Rogerson", "name" : "Steve Rogerson" }, { + "name" : "Veesh Goldman", "data" : [ [ "Perl 5", 5 ] ], - "id" : "Veesh Goldman", - "name" : "Veesh Goldman" + "id" : "Veesh Goldman" }, { "name" : "Alex Daniel", + "id" : "Alex Daniel", "data" : [ [ "Perl 6", 4 ] - ], - "id" : "Alex Daniel" + ] }, { + "name" : "Arpad Toth", + "id" : "Arpad Toth", "data" : [ [ "Perl 5", 4 ] - ], - "name" : "Arpad Toth", - "id" : "Arpad Toth" + ] }, { "id" : "Bob Kleemann", @@ -419,90 +678,101 @@ 4 ] ], - "name" : "Chenyf", - "id" : "Chenyf" + "id" : "Chenyf", + "name" : "Chenyf" }, { "name" : "David Kayal", + "id" : "David Kayal", "data" : [ [ "Perl 5", 4 ] - ], - "id" : "David Kayal" + ] }, { - "name" : "Jaime Corchado", + "id" : "Jaime Corchado", "data" : [ [ "Perl 5", 4 ] ], - "id" : "Jaime Corchado" + "name" : "Jaime Corchado" }, { + "name" : "Matt Latusek", "data" : [ [ "Perl 5", 4 ] ], - "name" : "Matt Latusek", "id" : "Matt Latusek" }, { + "name" : "Maxim Kolodyazhny", "data" : [ [ "Perl 5", 4 ] ], - "name" : "Maxim Kolodyazhny", "id" : "Maxim Kolodyazhny" }, { + "name" : "Ozzy", "id" : "Ozzy", "data" : [ [ "Perl 6", 4 ] - ], - "name" : "Ozzy" + ] }, { - "name" : "Simon Reinhardt", "data" : [ [ "Perl 5", 4 ] ], - "id" : "Simon Reinhardt" + "id" : "Simon Reinhardt", + "name" : "Simon Reinhardt" }, { - "name" : "Steven Wilson", "data" : [ [ "Perl 5", 4 ] ], - "id" : "Steven Wilson" + "id" : "Steven Wilson", + "name" : "Steven Wilson" + }, + { + "data" : [ + [ + "Perl 6", + 4 + ] + ], + "id" : "Tim Smith", + "name" : "Tim Smith" }, { - "name" : "Ailbhe Tweedie", "data" : [ [ "Perl 5", 3 ] ], - "id" : "Ailbhe Tweedie" + "id" : "Ailbhe Tweedie", + "name" : "Ailbhe Tweedie" }, { + "id" : "Dave Cross", "data" : [ [ "Blog", @@ -513,10 +783,10 @@ 2 ] ], - "id" : "Dave Cross", "name" : "Dave Cross" }, { + "id" : "Dave Jacoby", "data" : [ [ "Blog", @@ -527,21 +797,20 @@ 1 ] ], - "id" : "Dave Jacoby", "name" : "Dave Jacoby" }, { + "id" : "E. Choroba", "data" : [ - [ - "Perl 5", - 2 - ], [ "Blog", 1 + ], + [ + "Perl 5", + 2 ] ], - "id" : "E. Choroba", "name" : "E. Choroba" }, { @@ -555,352 +824,83 @@ "id" : "Freddie B" }, { + "name" : "Jeremy Carman", "id" : "Jeremy Carman", "data" : [ - [ - "Perl 5", - 2 - ], [ "Perl 6", 1 + ], + [ + "Perl 5", + 2 ] - ], - "name" : "Jeremy Carman" + ] }, { "name" : "Kivanc Yazan", + "id" : "Kivanc Yazan", "data" : [ [ "Perl 5", 3 ] - ], - "id" : "Kivanc Yazan" + ] }, { - "name" : "Neil Bowers", "data" : [ [ "Perl 5", 3 ] ], - "id" : "Neil Bowers" + "id" : "Neil Bowers", + "name" : "Neil Bowers" }, { - "name" : "Pete Houston", "data" : [ [ "Perl 5", 3 ] ], - "id" : "Pete Houston" + "id" : "Pete Houston", + "name" : "Pete Houston" }, { + "id" : "Sean Meininger", "data" : [ [ "Perl 6", 3 ] ], - "id" : "Sean Meininger", "name" : "Sean Meininger" }, { - "data" : [ - [ - "Perl 5", - 2 - ] - ], + "name" : "Abigail", "id" : "Abigail", - "name" : "Abigail" - }, - { - "id" : "Alicia Bielsa", "data" : [ [ "Perl 5", 2 ] - ], - "name" : "Alicia Bielsa" + ] } ] }, - "subtitle" : { - "text" : "Click the columns to drilldown the score breakdown. Last updated at 2019-04-29 09:24:07 GMT" + "xAxis" : { + "type" : "category" }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } + "legend" : { + "enabled" : "false" }, - "series" : [ - { - "data" : [ - { - "y" : 50, - "name" : "#1: Joelle Maslak", - "drilldown" : "Joelle Maslak" - }, - { - "y" : 48, - "drilldown" : "Laurent Rosenfeld", - "name" : "#2: Laurent Rosenfeld" - }, - { - "name" : "#3: Jaldhar H. Vyas", - "drilldown" : "Jaldhar H. Vyas", - "y" : 40 - }, - { - "drilldown" : "Dr James A. Smith", - "name" : "#4: Dr James A. Smith", - "y" : 36 - }, - { - "y" : 36, - "drilldown" : "Jo Christian Oterhals", - "name" : "#5: Jo Christian Oterhals" - }, - { - "name" : "#6: Simon Proctor", - "drilldown" : "Simon Proctor", - "y" : 36 - }, - { - "drilldown" : "Nick Logan", - "name" : "#7: Nick Logan", - "y" : 32 - }, - { - "drilldown" : "Ruben Westerberg", - "name" : "#8: Ruben Westerberg", - "y" : 32 - }, - { - "drilldown" : "Adam Russell", - "name" : "#9: Adam Russell", - "y" : 30 - }, - { - "name" : "#10: Lars Balker", - "drilldown" : "Lars Balker", - "y" : 28 - }, - { - "y" : 26, - "drilldown" : "Mark Senn", - "name" : "#11: Mark Senn" - }, - { - "y" : 24, - "name" : "#12: Arne Sommer", - "drilldown" : "Arne Sommer" - }, - { - "y" : 24, - "drilldown" : "Kian-Meng Ang", - "name" : "#13: Kian-Meng Ang" - }, - { - "drilldown" : "Gustavo Chaves", - "name" : "#14: Gustavo Chaves", - "y" : 22 - }, - { - "name" : "#15: Andrezgz", - "drilldown" : "Andrezgz", - "y" : 20 - }, - { - "y" : 20, - "name" : "#16: Athanasius", - "drilldown" : "Athanasius" - }, - { - "name" : "#17: Doug Schrag", - "drilldown" : "Doug Schrag", - "y" : 20 - }, - { - "y" : 18, - "name" : "#18: Francis Whittle", - "drilldown" : "Francis Whittle" - }, - { - "name" : "#19: Duncan C. White", - "drilldown" : "Duncan C. White", - "y" : 16 - }, - { - "drilldown" : "Robert Gratza", - "name" : "#20: Robert Gratza", - "y" : 16 - }, - { - "y" : 14, - "name" : "#21: John Barrett", - "drilldown" : "John Barrett" - }, - { - "y" : 12, - "drilldown" : "Daniel Mantovani", - "name" : "#22: Daniel Mantovani" - }, - { - "y" : 12, - "drilldown" : "Philippe Bruhat", - "name" : "#23: Philippe Bruhat" - }, - { - "name" : "#24: Sergio Iglesias", - "drilldown" : "Sergio Iglesias", - "y" : 12 - }, - { - "y" : 10, - "name" : "#25: Khalid", - "drilldown" : "Khalid" - }, - { - "y" : 10, - "drilldown" : "Steve Rogerson", - "name" : "#26: Steve Rogerson" - }, - { - "drilldown" : "Veesh Goldman", - "name" : "#27: Veesh Goldman", - "y" : 10 - }, - { - "drilldown" : "Alex Daniel", - "name" : "#28: Alex Daniel", - "y" : 8 - }, - { - "name" : "#29: Arpad Toth", - "drilldown" : "Arpad Toth", - "y" : 8 - }, - { - "y" : 8, - "drilldown" : "Bob Kleemann", - "name" : "#30: Bob Kleemann" - }, - { - "y" : 8, - "drilldown" : "Chenyf", - "name" : "#31: Chenyf" - }, - { - "drilldown" : "David Kayal", - "name" : "#32: David Kayal", - "y" : 8 - }, - { - "y" : 8, - "name" : "#33: Jaime Corchado", - "drilldown" : "Jaime Corchado" - }, - { - "name" : "#34: Matt Latusek", - "drilldown" : "Matt Latusek", - "y" : 8 - }, - { - "drilldown" : "Maxim Kolodyazhny", - "name" : "#35: Maxim Kolodyazhny", - "y" : 8 - }, - { - "name" : "#36: Ozzy", - "drilldown" : "Ozzy", - "y" : 8 - }, - { - "y" : 8, - "drilldown" : "Simon Reinhardt", - "name" : "#37: Simon Reinhardt" - }, - { - "y" : 8, - "drilldown" : "Steven Wilson", - "name" : "#38: Steven Wilson" - }, - { - "y" : 6, - "drilldown" : "Ailbhe Tweedie", - "name" : "#39: Ailbhe Tweedie" - }, - { - "name" : "#40: Dave Cross", - "drilldown" : "Dave Cross", - "y" : 6 - }, - { - "drilldown" : "Dave Jacoby", - "name" : "#41: Dave Jacoby", - "y" : 6 - }, - { - "drilldown" : "E. Choroba", - "name" : "#42: E. Choroba", - "y" : 6 - }, - { - "name" : "#43: Freddie B", - "drilldown" : "Freddie B", - "y" : 6 - }, - { - "drilldown" : "Jeremy Carman", - "name" : "#44: Jeremy Carman", - "y" : 6 - }, - { - "y" : 6, - "name" : "#45: Kivanc Yazan", - "drilldown" : "Kivanc Yazan" - }, - { - "y" : 6, - "drilldown" : "Neil Bowers", - "name" : "#46: Neil Bowers" - }, - { - "y" : 6, - "drilldown" : "Pete Houston", - "name" : "#47: Pete Houston" - }, - { - "y" : 6, - "drilldown" : "Sean Meininger", - "name" : "#48: Sean Meininger" - }, - { - "y" : 4, - "name" : "#49: Abigail", - "drilldown" : "Abigail" - }, - { - "y" : 4, - "drilldown" : "Alicia Bielsa", - "name" : "#50: Alicia Bielsa" - } - ], - "name" : "Perl Weekly Challenge Leaders", - "colorByPoint" : "true" + "title" : { + "text" : "Perl Weekly Challenge Leaders (TOP 50)" + }, + "yAxis" : { + "title" : { + "text" : "Total Score" } - ], - "xAxis" : { - "type" : "category" } } diff --git a/stats/pwc-summary-1-30.json b/stats/pwc-summary-1-30.json index 0f6356b7cd..738a53b747 100644 --- a/stats/pwc-summary-1-30.json +++ b/stats/pwc-summary-1-30.json @@ -1,38 +1,4 @@ { - "xAxis" : { - "categories" : [ - "Abigail", - "Adam Russell", - "Ailbhe Tweedie", - "Alex Daniel", - "Alexander Karelas", - "Alexey Melezhik", - "Alicia Bielsa", - "Andrezgz", - "Antonio Gamiz", - "Arne Sommer", - "Arpad Toth", - "Athanasius", - "Aubrey Quarcoo", - "Bill Palmer", - "Bob Kleemann", - "Clive Holloway", - "Daniel Mantovani", - "Dave Cross", - "Dave Jacoby", - "David Kayal", - "Doug Schrag", - "Duncan C. White", - "E. Choroba", - "Eddy HS", - "Finley", - "Francis Whittle", - "Fred Zinn", - "Freddie B", - "Guillermo Ramos", - "Gustavo Chaves" - ] - }, "title" : { "text" : "Perl Weekly Challenge - 2019" }, @@ -42,21 +8,23 @@ "text" : "" } }, + "subtitle" : { + "text" : "[Champions: 30] Last updated at 2019-05-01 10:34:45 GMT" + }, "plotOptions" : { "column" : { "stacking" : "percent" } }, - "tooltip" : { - "shared" : 1, - "pointFormat" : "{series.name}: {point.y}
" - }, "chart" : { "type" : "column" }, + "tooltip" : { + "pointFormat" : "{series.name}: {point.y}
", + "shared" : 1 + }, "series" : [ { - "name" : "Perl 5", "data" : [ 2, 10, @@ -87,8 +55,9 @@ 2, 3, 1, - 7 - ] + 9 + ], + "name" : "Perl 5" }, { "data" : [ @@ -126,7 +95,38 @@ "name" : "Perl 6" } ], - "subtitle" : { - "text" : "[Champions: 30] Last updated at 2019-04-29 09:24:04 GMT" + "xAxis" : { + "categories" : [ + "Abigail", + "Adam Russell", + "Ailbhe Tweedie", + "Alex Daniel", + "Alexander Karelas", + "Alexey Melezhik", + "Alicia Bielsa", + "Andrezgz", + "Antonio Gamiz", + "Arne Sommer", + "Arpad Toth", + "Athanasius", + "Aubrey Quarcoo", + "Bill Palmer", + "Bob Kleemann", + "Clive Holloway", + "Daniel Mantovani", + "Dave Cross", + "Dave Jacoby", + "David Kayal", + "Doug Schrag", + "Duncan C. White", + "E. Choroba", + "Eddy HS", + "Finley", + "Francis Whittle", + "Fred Zinn", + "Freddie B", + "Guillermo Ramos", + "Gustavo Chaves" + ] } } diff --git a/stats/pwc-summary-31-60.json b/stats/pwc-summary-31-60.json index 27f59208a5..d32f16be35 100644 --- a/stats/pwc-summary-31-60.json +++ b/stats/pwc-summary-31-60.json @@ -1,4 +1,16 @@ { + "plotOptions" : { + "column" : { + "stacking" : "percent" + } + }, + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "{series.name}: {point.y}
", + "shared" : 1 + }, "xAxis" : { "categories" : [ "Jacques Guinnebault", @@ -33,26 +45,9 @@ "Pete Houston" ] }, - "title" : { - "text" : "Perl Weekly Challenge - 2019" - }, - "plotOptions" : { - "column" : { - "stacking" : "percent" - } - }, - "tooltip" : { - "pointFormat" : "{series.name}: {point.y}
", - "shared" : 1 - }, - "yAxis" : { - "min" : 0, - "title" : { - "text" : "" - } - }, "series" : [ { + "name" : "Perl 5", "data" : [ 0, 4, @@ -84,11 +79,9 @@ 0, 2, 3 - ], - "name" : "Perl 5" + ] }, { - "name" : "Perl 6", "data" : [ 0, 0, @@ -120,13 +113,20 @@ 4, 0, 0 - ] + ], + "name" : "Perl 6" } ], - "subtitle" : { - "text" : "[Champions: 30] Last updated at 2019-04-29 09:24:04 GMT" + "title" : { + "text" : "Perl Weekly Challenge - 2019" }, - "chart" : { - "type" : "column" + "yAxis" : { + "title" : { + "text" : "" + }, + "min" : 0 + }, + "subtitle" : { + "text" : "[Champions: 30] Last updated at 2019-05-01 10:34:45 GMT" } } diff --git a/stats/pwc-summary-61-90.json b/stats/pwc-summary-61-90.json index 6515600d6a..1d3eb8fc07 100644 --- a/stats/pwc-summary-61-90.json +++ b/stats/pwc-summary-61-90.json @@ -1,10 +1,11 @@ { - "subtitle" : { - "text" : "[Champions: 17] Last updated at 2019-04-29 09:24:04 GMT" + "plotOptions" : { + "column" : { + "stacking" : "percent" + } }, "series" : [ { - "name" : "Perl 5", "data" : [ 4, 2, @@ -23,9 +24,11 @@ 5, 1, 1 - ] + ], + "name" : "Perl 5" }, { + "name" : "Perl 6", "data" : [ 0, 0, @@ -33,41 +36,23 @@ 8, 3, 0, - 10, + 11, 0, 2, 0, 0, 0, - 2, + 4, 0, 0, 0, 1 - ], - "name" : "Perl 6" + ] } ], - "chart" : { - "type" : "column" - }, "tooltip" : { - "shared" : 1, - "pointFormat" : "{series.name}: {point.y}
" - }, - "plotOptions" : { - "column" : { - "stacking" : "percent" - } - }, - "yAxis" : { - "min" : 0, - "title" : { - "text" : "" - } - }, - "title" : { - "text" : "Perl Weekly Challenge - 2019" + "pointFormat" : "{series.name}: {point.y}
", + "shared" : 1 }, "xAxis" : { "categories" : [ @@ -89,5 +74,20 @@ "William Gilmore", "Yary H" ] + }, + "chart" : { + "type" : "column" + }, + "subtitle" : { + "text" : "[Champions: 17] Last updated at 2019-05-01 10:34:45 GMT" + }, + "yAxis" : { + "min" : 0, + "title" : { + "text" : "" + } + }, + "title" : { + "text" : "Perl Weekly Challenge - 2019" } } diff --git a/stats/pwc-summary.json b/stats/pwc-summary.json index 438f42e577..d18b18a3ba 100644 --- a/stats/pwc-summary.json +++ b/stats/pwc-summary.json @@ -2,23 +2,111 @@ "chart" : { "type" : "column" }, + "tooltip" : { + "shared" : 1, + "pointFormat" : "{series.name}: {point.y}
" + }, + "xAxis" : { + "categories" : [ + "Abigail", + "Adam Russell", + "Ailbhe Tweedie", + "Alex Daniel", + "Alexander Karelas", + "Alexey Melezhik", + "Alicia Bielsa", + "Andrezgz", + "Antonio Gamiz", + "Arne Sommer", + "Arpad Toth", + "Athanasius", + "Aubrey Quarcoo", + "Bill Palmer", + "Bob Kleemann", + "Clive Holloway", + "Daniel Mantovani", + "Dave Cross", + "Dave Jacoby", + "David Kayal", + "Doug Schrag", + "Duncan C. White", + "E. Choroba", + "Eddy HS", + "Finley", + "Francis Whittle", + "Fred Zinn", + "Freddie B", + "Guillermo Ramos", + "Gustavo Chaves", + "Jacques Guinnebault", + "Jaime Corchado", + "Jaldhar H. Vyas", + "Dr James A. Smith", + "Jeff", + "Jeremy Carman", + "Jim Bacon", + "JJ Merelo", + "Jo Christian Oterhals", + "Joelle Maslak", + "John Barrett", + "Juan Caballero", + "Khalid", + "Kian-Meng Ang", + "Kivanc Yazan", + "Lars Balker", + "Laurent Rosenfeld", + "Magnus Woldrich", + "Mark Senn", + "Martin Mugeni", + "Matt Latusek", + "Maxim Kolodyazhny", + "Michael Schaap", + "Neil Bowers", + "Nick Logan", + "Chenyf", + "Oleksii Tsvietnov", + "Ozzy", + "Pavel Jurca", + "Pete Houston", + "Philippe Bruhat", + "Prajith P", + "Robert Gratza", + "Ruben Westerberg", + "Sean Meininger", + "Sergio Iglesias", + "Simon Proctor", + "Simon Reinhardt", + "Steve Rogerson", + "Steven Lembark", + "Steven Wilson", + "Tiago Stock", + "Tim Smith", + "Tore Andersson", + "Veesh Goldman", + "William Gilmore", + "Yary H" + ] + }, + "title" : { + "text" : "Perl Weekly Challenge - 2019" + }, "yAxis" : { "min" : 0, "title" : { "text" : "" } }, - "tooltip" : { - "shared" : 1, - "pointFormat" : "{series.name}: {point.y}
" - }, "plotOptions" : { "column" : { "stacking" : "percent" } }, + "subtitle" : { + "text" : "[Champions: 77] Last updated at 2019-05-01 10:34:44 GMT" + }, "series" : [ { + "name" : "Perl 5", "data" : [ 2, 10, @@ -49,7 +137,7 @@ 2, 3, 1, - 7, + 9, 0, 4, 10, @@ -97,8 +185,7 @@ 5, 1, 1 - ], - "name" : "Perl 5" + ] }, { "data" : [ @@ -168,13 +255,13 @@ 8, 3, 0, - 10, + 11, 0, 2, 0, 0, 0, - 2, + 4, 0, 0, 0, @@ -182,92 +269,5 @@ ], "name" : "Perl 6" } - ], - "subtitle" : { - "text" : "[Champions: 77] Last updated at 2019-04-29 09:24:04 GMT" - }, - "title" : { - "text" : "Perl Weekly Challenge - 2019" - }, - "xAxis" : { - "categories" : [ - "Abigail", - "Adam Russell", - "Ailbhe Tweedie", - "Alex Daniel", - "Alexander Karelas", - "Alexey Melezhik", - "Alicia Bielsa", - "Andrezgz", - "Antonio Gamiz", - "Arne Sommer", - "Arpad Toth", - "Athanasius", - "Aubrey Quarcoo", - "Bill Palmer", - "Bob Kleemann", - "Clive Holloway", - "Daniel Mantovani", - "Dave Cross", - "Dave Jacoby", - "David Kayal", - "Doug Schrag", - "Duncan C. White", - "E. Choroba", - "Eddy HS", - "Finley", - "Francis Whittle", - "Fred Zinn", - "Freddie B", - "Guillermo Ramos", - "Gustavo Chaves", - "Jacques Guinnebault", - "Jaime Corchado", - "Jaldhar H. Vyas", - "Dr James A. Smith", - "Jeff", - "Jeremy Carman", - "Jim Bacon", - "JJ Merelo", - "Jo Christian Oterhals", - "Joelle Maslak", - "John Barrett", - "Juan Caballero", - "Khalid", - "Kian-Meng Ang", - "Kivanc Yazan", - "Lars Balker", - "Laurent Rosenfeld", - "Magnus Woldrich", - "Mark Senn", - "Martin Mugeni", - "Matt Latusek", - "Maxim Kolodyazhny", - "Michael Schaap", - "Neil Bowers", - "Nick Logan", - "Chenyf", - "Oleksii Tsvietnov", - "Ozzy", - "Pavel Jurca", - "Pete Houston", - "Philippe Bruhat", - "Prajith P", - "Robert Gratza", - "Ruben Westerberg", - "Sean Meininger", - "Sergio Iglesias", - "Simon Proctor", - "Simon Reinhardt", - "Steve Rogerson", - "Steven Lembark", - "Steven Wilson", - "Tiago Stock", - "Tim Smith", - "Tore Andersson", - "Veesh Goldman", - "William Gilmore", - "Yary H" - ] - } + ] } -- cgit From 97cdd5f7f453912e7dfb8c46fa80bb41e988f8e6 Mon Sep 17 00:00:00 2001 From: aliciabielsa Date: Wed, 1 May 2019 16:55:02 +0200 Subject: Add Challenge 1 Week 6 --- challenge-006/alicia-bielsa/perl5/ch-1.pl | 85 +++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 challenge-006/alicia-bielsa/perl5/ch-1.pl diff --git a/challenge-006/alicia-bielsa/perl5/ch-1.pl b/challenge-006/alicia-bielsa/perl5/ch-1.pl new file mode 100644 index 0000000000..9570089b3a --- /dev/null +++ b/challenge-006/alicia-bielsa/perl5/ch-1.pl @@ -0,0 +1,85 @@ +#Challenge #1 week 6 +#Create a script which takes a list of numbers from command line and +#print the same in the compact form. For example, +#if you pass “1,2,3,4,9,10,14,15,16” then it should print the compact form like “1-4,9,10,14-16”. + + +use strict; +use warnings; +use Data::Dumper; + +my $askForInput = 1; +my $errorMessage = ''; +my $compactedNumbers = ''; +my $rangeDivider = '-'; +my $numberDivider = ','; + +while ($askForInput){ + + if ($errorMessage ){ + print "ERROR: $errorMessage\n"; + } + my $input = getInput(); + print "Input: '$input'\n"; + if ($input =~ /[\d+]/){ + $errorMessage = ''; + $compactedNumbers = compactNumbers($input); + print "Compact form: $compactedNumbers\n"; + } else { + $errorMessage = "Only digits separated by commas are valid input\n"; + } + if ($input =~ /^q|quit$/i){ + print "Bye bye\n"; + $askForInput = 0; + } +} + + sub getInput { + print "Enter numbers separated by commas, example: 1,2,3\nEnter quit(q) to exit\n"; + my $input = ; + chomp($input); + $input =~ s%\s+%%g; #eliminate spaces + $input =~ s%^,+%%g; #eliminate commas at begining + $input =~ s%,+$%%g; #eliminate commas at end + $input =~ s%,+%,%g; #eliminate duplicated commas + return $input; + } + + sub compactNumbers { + my $numbers = shift; + my $compactNumbers = ''; + my @aNumbers = split ( ',' , $numbers ); + + #we eliminate duplicated numbers by passing to hash and back to array + my %hNumbers = (); + $hNumbers{$_}++ for (@aNumbers); + @aNumbers = keys %hNumbers; + + # we sort the numbers + @aNumbers = sort { $a <=> $b } @aNumbers; + + my $rangeCount = 0; + my $divider = ''; + + for my $i (0 .. $#aNumbers) { + unless ( $i == 0 ){ + $divider = $numberDivider; + } + if ( ( $i != $#aNumbers ) && ( $aNumbers[$i] +1 == $aNumbers[$i+1] ) ){ + $rangeCount++; + if ( $rangeCount > 1 ){ + next; + } + } else { + if ( $rangeCount > 1 ){ + $divider = $rangeDivider; + } + $rangeCount = 0; + } + $compactNumbers .= $divider.$aNumbers[$i]; + } + + return $compactNumbers; + } + + -- cgit From d83b768b10245ee334907efea43a6a5a0820062e Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar