diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2022-11-28 16:50:29 +0000 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2022-11-28 16:50:29 +0000 |
| commit | ed24be5652a8686c1fd5d68abed68895caf6300c (patch) | |
| tree | 814b0e47c4671f1d24fffa5f19f788ef1a30aecc | |
| parent | 98a5f6a69d91a88d08bc18b8aa82558b663d09bb (diff) | |
| download | perlweeklychallenge-club-ed24be5652a8686c1fd5d68abed68895caf6300c.tar.gz perlweeklychallenge-club-ed24be5652a8686c1fd5d68abed68895caf6300c.tar.bz2 perlweeklychallenge-club-ed24be5652a8686c1fd5d68abed68895caf6300c.zip | |
- Added solutions by Robert DiCicco.
| -rw-r--r-- | challenge-193/robert-dicicco/julia/ch-1.jl | 89 | ||||
| -rw-r--r-- | challenge-193/robert-dicicco/perl/ch-1.pl | 93 | ||||
| -rw-r--r-- | challenge-193/robert-dicicco/raku/ch-1.raku | 89 | ||||
| -rw-r--r-- | challenge-193/robert-dicicco/ruby/ch-1.rb | 89 | ||||
| -rw-r--r-- | stats/pwc-current.json | 207 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 48 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 1370 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 384 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 92 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 126 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 32 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 54 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 96 | ||||
| -rw-r--r-- | stats/pwc-summary-241-270.json | 40 | ||||
| -rw-r--r-- | stats/pwc-summary-271-300.json | 68 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 50 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 40 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 108 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 600 |
19 files changed, 2027 insertions, 1648 deletions
diff --git a/challenge-193/robert-dicicco/julia/ch-1.jl b/challenge-193/robert-dicicco/julia/ch-1.jl new file mode 100644 index 0000000000..dff5db89c0 --- /dev/null +++ b/challenge-193/robert-dicicco/julia/ch-1.jl @@ -0,0 +1,89 @@ +#!/usr/bin/env julia + +#= + +AUTHOR: Robert DiCicco + +DATE: 2022-11-28 + +Challenge 193 Binary String ( Julia ) + + + +Write a script to find all possible binary numbers of size $n. + +Example 1 + + + +Input: $n = 2 + +Output: 00, 11, 01, 10 + + + +Example 2 + + + +Input: $n = 3 + +Output: 000, 001, 010, 100, 111, 110, 101, 011 + +------------------------------------------------------ + +SAMPLE OUTPUT + +julia .\BinaryString.jl + +Input: $n = 2 + +Output: 00 01 10 11 + + + +Input: $n = 3 + +Output: 000 001 010 011 100 101 110 111 + + + +Input: $n = 4 + +Output: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 + +=# + + + +using Printf + + + +arr = [2,3,4] + +maxv = [3,7,15] + + + +x = 1 + +for p in arr + + @printf("Input: \$n = %d\n", p) + + @printf("Output: ") + + global x + + for n in (0:maxv[x]) + + @printf("%s ", string(n, base=2, pad=p)) + + end + + println("\n") + + x += 1 + +end diff --git a/challenge-193/robert-dicicco/perl/ch-1.pl b/challenge-193/robert-dicicco/perl/ch-1.pl new file mode 100644 index 0000000000..e19e03eb51 --- /dev/null +++ b/challenge-193/robert-dicicco/perl/ch-1.pl @@ -0,0 +1,93 @@ +#!/usr/bin/env perl + +=begin pod + +AUTHOR: Robert DiCicco + +DATE: 2022-11-28 + +Challenge 193 Binary String ( Perl ) + + + +Write a script to find all possible binary numbers of size $n. + +Example 1 + + + +Input: $n = 2 + +Output: 00, 11, 01, 10 + + + +Example 2 + + + +Input: $n = 3 + +Output: 000, 001, 010, 100, 111, 110, 101, 011 + +------------------------------------------------------ + +SAMPLE OUTPUT + +perl .\BinaryString.pl + +Input: $n = 2 + +Output: 00 01 10 11 + + + +Input: $n = 3 + +Output: 000 001 010 011 100 101 110 111 + +=cut + + + +use strict; + +use warnings; + +use boolean; + +use feature qw/say/; + + + +my @arr = (2,3); + + + +for my $n (@arr) { + + say "Input: \$n = $n"; + + my $x = 0; + + print "Output: "; + + while ( true ) { + + my $str = sprintf ("%0*b", $n,$x); + + if(length($str) > $n) { + + last; + + } + + print "$str "; + + $x++; + + } + + say "\n"; + +} diff --git a/challenge-193/robert-dicicco/raku/ch-1.raku b/challenge-193/robert-dicicco/raku/ch-1.raku new file mode 100644 index 0000000000..7b07f2258f --- /dev/null +++ b/challenge-193/robert-dicicco/raku/ch-1.raku @@ -0,0 +1,89 @@ +use v6; + +=begin pod + +AUTHOR: Robert DiCicco + +DATE: 2022-11-28 + +Challenge 193 Binary String ( Raku ) + + + +Write a script to find all possible binary numbers of size $n. + +Example 1 + + + +Input: $n = 2 + +Output: 00, 11, 01, 10 + + + +Example 2 + + + +Input: $n = 3 + +Output: 000, 001, 010, 100, 111, 110, 101, 011 + +------------------------------------------------------ + +SAMPLE OUTPUT + +raku .\BinaryString.rk + +Input: $n = 2 + +Output: 00 01 10 11 + + + +Input: $n = 3 + +Output: 000 001 010 011 100 101 110 111 + + + +Input: $n = 4 + +Output: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 + +=end pod + + + +my @arr = (2,3,4); + + + +for (@arr) -> $n { + + say "Input: \$n = $n"; + + my $x = 0; + + print "Output: "; + + while True { + + my $str = sprintf <%0*b>, $n,$x; + + if $str.chars > $n { + + last; + + } + + print "$str "; + + $x++; + + } + + say "\n"; + + } diff --git a/challenge-193/robert-dicicco/ruby/ch-1.rb b/challenge-193/robert-dicicco/ruby/ch-1.rb new file mode 100644 index 0000000000..b338c916ad --- /dev/null +++ b/challenge-193/robert-dicicco/ruby/ch-1.rb @@ -0,0 +1,89 @@ +#!/usr/bin/env ruby + +=begin + +AUTHOR: Robert DiCicco + +DATE: 2022-11-28 + +Challenge 193 Binary String ( Ruby ) + + + +Write a script to find all possible binary numbers of size $n. + +Example 1 + + + +Input: $n = 2 + +Output: 00, 11, 01, 10 + + + +Example 2 + + + +Input: $n = 3 + +Output: 000, 001, 010, 100, 111, 110, 101, 011 + +------------------------------------------------------ + +SAMPLE OUTPUT + +ruby .\BinaryString.rb + +Input: $n = 2 + +Output: 00 01 10 11 + + + +Input: $n = 3 + +Output: 000 001 010 011 100 101 110 111 + + + +Input: $n = 4 + +Output: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 + +=end + + + +arr = [2,3,4] + + + +arr.each do |n| + + puts "Input: \$n = #{n}"; + + x = 0; + + print "Output: "; + + while 1==1 + + str = sprintf("%0*b", n,x) + + if str.length > n + + break + + end + + print "#{str} " + + x += 1 + + end + + print "\n\n" + +end diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 61d9518f29..480526372a 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,86 +1,4 @@ { - "title" : { - "text" : "The Weekly Challenge - 193" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } - } - }, - "legend" : { - "enabled" : 0 - }, - "chart" : { - "type" : "column" - }, - "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 - }, - "subtitle" : { - "text" : "[Champions: 8] Last updated at 2022-11-28 16:21:41 GMT" - }, - "xAxis" : { - "type" : "category" - }, - "series" : [ - { - "name" : "The Weekly Challenge - 193", - "colorByPoint" : 1, - "data" : [ - { - "drilldown" : "Luca Ferrari", - "y" : 8, - "name" : "Luca Ferrari" - }, - { - "drilldown" : "Mark Anderson", - "name" : "Mark Anderson", - "y" : 2 - }, - { - "y" : 2, - "name" : "Niels van Dijke", - "drilldown" : "Niels van Dijke" - }, - { - "drilldown" : "Olivier Delouya", - "y" : 1, - "name" : "Olivier Delouya" - }, - { - "drilldown" : "Peter Campbell Smith", - "y" : 3, - "name" : "Peter Campbell Smith" - }, - { - "y" : 4, - "name" : "Roger Bell_West", - "drilldown" : "Roger Bell_West" - }, - { - "drilldown" : "Simon Proctor", - "name" : "Simon Proctor", - "y" : 1 - }, - { - "drilldown" : "Stephen G. Lynn", - "name" : "Stephen G. Lynn", - "y" : 5 - } - ] - } - ], - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, "drilldown" : { "series" : [ { @@ -98,8 +16,8 @@ ] }, { - "id" : "Mark Anderson", "name" : "Mark Anderson", + "id" : "Mark Anderson", "data" : [ [ "Raku", @@ -108,26 +26,27 @@ ] }, { - "id" : "Niels van Dijke", "name" : "Niels van Dijke", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Niels van Dijke" }, { + "name" : "Olivier Delouya", + "id" : "Olivier Delouya", "data" : [ [ "Perl", 1 ] - ], - "id" : "Olivier Delouya", - "name" : "Olivier Delouya" + ] }, { + "id" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -138,10 +57,25 @@ 1 ] ], - "name" : "Peter Campbell Smith", - "id" : "Peter Campbell Smith" + "name" : "Peter Campbell Smith" + }, + { + "name" : "Robert DiCicco", + "id" : "Robert DiCicco", + "data" : [ + [ + "Perl", + 1 + ], + [ + "Raku", + 1 + ] + ] }, { + "name" : "Roger Bell_West", + "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -151,9 +85,7 @@ "Raku", 2 ] - ], - "id" : "Roger Bell_West", - "name" : "Roger Bell_West" + ] }, { "name" : "Simon Proctor", @@ -166,6 +98,7 @@ ] }, { + "id" : "Stephen G. Lynn", "data" : [ [ "Perl", @@ -180,9 +113,95 @@ 1 ] ], - "id" : "Stephen G. Lynn", "name" : "Stephen G. Lynn" } ] + }, + "series" : [ + { + "colorByPoint" : 1, + "name" : "The Weekly Challenge - 193", + "data" : [ + { + "name" : "Luca Ferrari", + "y" : 8, + "drilldown" : "Luca Ferrari" + }, + { + "drilldown" : "Mark Anderson", + "y" : 2, + "name" : "Mark Anderson" + }, + { + "y" : 2, + "drilldown" : "Niels van Dijke", + "name" : "Niels van Dijke" + }, + { + "y" : 1, + "drilldown" : "Olivier Delouya", + "name" : "Olivier Delouya" + }, + { + "y" : 3, + "drilldown" : "Peter Campbell Smith", + "name" : "Peter Campbell Smith" + }, + { + "name" : "Robert DiCicco", + "drilldown" : "Robert DiCicco", + "y" : 2 + }, + { + "name" : "Roger Bell_West", + "drilldown" : "Roger Bell_West", + "y" : 4 + }, + { + "y" : 1, + "drilldown" : "Simon Proctor", + "name" : "Simon Proctor" + }, + { + "y" : 5, + "drilldown" : "Stephen G. Lynn", + "name" : "Stephen G. Lynn" + } + ] + } + ], + "xAxis" : { + "type" : "category" + }, + "chart" : { + "type" : "column" + }, + "title" : { + "text" : "The Weekly Challenge - 193" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, + "legend" : { + "enabled" : 0 + }, + "subtitle" : { + "text" : "[Champions: 9] Last updated at 2022-11-28 16:45:48 GMT" + }, + "tooltip" : { + "followPointer" : 1, + "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/>" } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 95551df734..88f10a2f06 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,21 +1,28 @@ { - "legend" : { - "enabled" : "false" - }, - "chart" : { - "type" : "column" + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" }, "title" : { "text" : "The Weekly Challenge Contributions [2019 - 2022]" }, "subtitle" : { - "text" : "Last updated at 2022-11-28 16:21:41 GMT" + "text" : "Last updated at 2022-11-28 16:45:48 GMT" }, - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" + "chart" : { + "type" : "column" + }, + "xAxis" : { + "labels" : { + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + } + }, + "type" : "category" }, "series" : [ { + "name" : "Contributions", "data" : [ [ "Blog", @@ -23,41 +30,34 @@ ], [ "Perl", - 9433 + 9434 ], [ "Raku", - 5670 + 5671 ] ], - "name" : "Contributions", "dataLabels" : { + "y" : 10, + "format" : "{point.y:.0f}", + "align" : "right", "style" : { "fontSize" : "13px", "fontFamily" : "Verdana, sans-serif" }, "rotation" : -90, - "y" : 10, - "format" : "{point.y:.0f}", - "enabled" : "true", "color" : "#FFFFFF", - "align" : "right" + "enabled" : "true" } } ], + "legend" : { + "enabled" : "false" + }, "yAxis" : { "title" : { "text" : null }, "min" : 0 - }, - "xAxis" : { - "type" : "category", - "labels" : { - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - } - } } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 4b01ef5346..f186dc5df7 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,17 +1,41 @@ { + "legend" : { + "enabled" : "false" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } + }, + "subtitle" : { + "text" : "Click the columns to drilldown the language breakdown. Last updated at 2022-11-28 16:45:48 GMT" + }, + "tooltip" : { + "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>", + "followPointer" : "true", + "headerFormat" : "<span style=\"font-size:11px\"></span>" + }, "series" : [ { - "name" : "The Weekly Challenge Languages", "data" : [ { - "y" : 161, "name" : "#001", - "drilldown" : "001" + "drilldown" : "001", + "y" : 161 }, { + "name" : "#002", "drilldown" : "002", - "y" : 125, - "name" : "#002" + "y" : 125 }, { "drilldown" : "003", @@ -19,24 +43,24 @@ "name" : "#003" }, { - "y" : 99, "name" : "#004", - "drilldown" : "004" + "drilldown" : "004", + "y" : 99 }, { - "drilldown" : "005", "name" : "#005", - "y" : 78 + "y" : 78, + "drilldown" : "005" }, { - "y" : 58, "name" : "#006", + "y" : 58, "drilldown" : "006" }, { - "name" : "#007", + "drilldown" : "007", "y" : 65, - "drilldown" : "007" + "name" : "#007" }, { "name" : "#008", @@ -44,69 +68,69 @@ "drilldown" : "008" }, { - "y" : 76, "name" : "#009", - "drilldown" : "009" + "drilldown" : "009", + "y" : 76 }, { - "name" : "#010", + "drilldown" : "010", "y" : 65, - "drilldown" : "010" + "name" : "#010" }, { - "name" : "#011", + "drilldown" : "011", "y" : 85, - "drilldown" : "011" + "name" : "#011" }, { - "drilldown" : "012", "name" : "#012", - "y" : 89 + "y" : 89, + "drilldown" : "012" }, { + "y" : 85, "drilldown" : "013", - "name" : "#013", - "y" : 85 + "name" : "#013" }, { - "drilldown" : "014", "name" : "#014", + "drilldown" : "014", "y" : 101 }, { - "drilldown" : "015", "y" : 99, + "drilldown" : "015", "name" : "#015" }, { + "name" : "#016", "drilldown" : "016", - "y" : 71, - "name" : "#016" + "y" : 71 }, { + "name" : "#017", "drilldown" : "017", - "y" : 84, - "name" : "#017" + "y" : 84 }, { "name" : "#018", - "y" : 81, - "drilldown" : "018" + "drilldown" : "018", + "y" : 81 }, { - "y" : 103, "name" : "#019", - "drilldown" : "019" + "drilldown" : "019", + "y" : 103 }, { + "drilldown" : "020", "y" : 101, - "name" : "#020", - "drilldown" : "020" + "name" : "#020" }, { - "drilldown" : "021", "name" : "#021", - "y" : 72 + "y" : 72, + "drilldown" : "021" }, { "name" : "#022", @@ -119,9 +143,9 @@ "drilldown" : "023" }, { - "y" : 75, "name" : "#024", - "drilldown" : "024" + "drilldown" : "024", + "y" : 75 }, { "drilldown" : "025", @@ -134,14 +158,14 @@ "name" : "#026" }, { + "name" : "#027", "drilldown" : "027", - "y" : 62, - "name" : "#027" + "y" : 62 }, { - "name" : "#028", + "drilldown" : "028", "y" : 82, - "drilldown" : "028" + "name" : "#028" }, { "drilldown" : "029", @@ -150,68 +174,68 @@ }, { "drilldown" : "030", - "name" : "#030", - "y" : 119 + "y" : 119, + "name" : "#030" }, { + "drilldown" : "031", "y" : 91, - "name" : "#031", - "drilldown" : "031" + "name" : "#031" }, { - "drilldown" : "032", + "name" : "#032", "y" : 96, - "name" : "#032" + "drilldown" : "032" }, { "drilldown" : "033", - "name" : "#033", - "y" : 112 + "y" : 112, + "name" : "#033" }, { "name" : "#034", - "y" : 66, - "drilldown" : "034" + "drilldown" : "034", + "y" : 66 }, { - "drilldown" : "035", "name" : "#035", - "y" : 66 + "y" : 66, + "drilldown" : "035" }, { - "drilldown" : "036", + "name" : "#036", "y" : 70, - "name" : "#036" + "drilldown" : "036" }, { - "drilldown" : "037", "y" : 69, + "drilldown" : "037", "name" : "#037" }, { - "drilldown" : "038", "name" : "#038", + "drilldown" : "038", "y" : 70 }, { - "y" : 64, "name" : "#039", - "drilldown" : "039" + "drilldown" : "039", + "y" : 64 }, { - "drilldown" : "040", + "name" : "#040", "y" : 75, - "name" : "#040" + "drilldown" : "040" }, { - "name" : "#041", "y" : 78, - "drilldown" : "041" + "drilldown" : "041", + "name" : "#041" }, { - "name" : "#042", "y" : 94, - "drilldown" : "042" + "drilldown" : "042", + "name" : "#042" }, { "name" : "#043", @@ -219,9 +243,9 @@ "drilldown" : "043" }, { + "name" : "#044", "drilldown" : "044", - "y" : 87, - "name" : "#044" + "y" : 87 }, { "drilldown" : "045", @@ -229,28 +253,28 @@ "name" : "#045" }, { - "y" : 89, "name" : "#046", - "drilldown" : "046" + "drilldown" : "046", + "y" : 89 }, { + "name" : "#047", "drilldown" : "047", - "y" : 86, - "name" : "#047" + "y" : 86 }, { - "name" : "#048", "y" : 110, - "drilldown" : "048" + "drilldown" : "048", + "name" : "#048" }, { - "drilldown" : "049", "y" : 91, + "drilldown" : "049", "name" : "#049" }, { - "y" : 100, "name" : "#050", + "y" : 100, "drilldown" : "050" }, { @@ -259,34 +283,34 @@ "name" : "#051" }, { - "drilldown" : "052", "name" : "#052", - "y" : 93 + "y" : 93, + "drilldown" : "052" }, { + "drilldown" : "053", "y" : 103, - "name" : "#053", - "drilldown" : "053" + "name" : "#053" }, { - "name" : "#054", "y" : 105, - "drilldown" : "054" + "drilldown" : "054", + "name" : "#054" }, { + "name" : "#055", "drilldown" : "055", - "y" : 90, - "name" : "#055" + "y" : 90 }, { - "y" : 97, "name" : "#056", + "y" : 97, "drilldown" : "056" }, |
