diff options
| -rw-r--r-- | challenge-150/robert-dicicco/perl/ch-1.pl | 38 | ||||
| -rw-r--r-- | challenge-150/robert-dicicco/perl/ch-2.pl | 35 | ||||
| -rw-r--r-- | challenge-150/robert-dicicco/raku/ch-1.raku | 26 | ||||
| -rw-r--r-- | challenge-150/robert-dicicco/raku/ch-2.raku | 30 | ||||
| -rw-r--r-- | challenge-150/robert-dicicco/ruby/ch-1.rb | 32 | ||||
| -rw-r--r-- | challenge-150/robert-dicicco/ruby/ch-2.rb | 47 | ||||
| -rw-r--r-- | stats/pwc-current.json | 151 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 62 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 1086 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 358 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 48 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 100 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 94 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 52 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 114 | ||||
| -rw-r--r-- | stats/pwc-summary-241-270.json | 54 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 106 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 40 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 38 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 48 |
20 files changed, 1393 insertions, 1166 deletions
diff --git a/challenge-150/robert-dicicco/perl/ch-1.pl b/challenge-150/robert-dicicco/perl/ch-1.pl new file mode 100644 index 0000000000..6441628bde --- /dev/null +++ b/challenge-150/robert-dicicco/perl/ch-1.pl @@ -0,0 +1,38 @@ +#!perl.exe + +use strict; +use warnings; +use 5.30.0; + +# Author: Robert DiCicco +# Date: 31-JAN-2022 +# Challenge 150 Fibonacci Words (Perl) + +my $a = '1234'; +my $b = '5678'; + +say "Fibonacci Words"; +say $a; +say $b; + +my $retval=Fib($a, $b); + +# get the 51st character +my $fibchr = substr($retval, 50, 1); +say "51st digit is $fibchr"; + +# recursive routine to create fibonacci series, but using strings + +sub Fib { + my $val = $_[0] . $_[1]; + say $val; + + # if new string length is less than 51, go another round using new combined string + + if (length($val) < 51) { + Fib($_[1], $val); + } else { + # return the string if length 51 or greater + return $val; + } +} diff --git a/challenge-150/robert-dicicco/perl/ch-2.pl b/challenge-150/robert-dicicco/perl/ch-2.pl new file mode 100644 index 0000000000..ce7fca6c4b --- /dev/null +++ b/challenge-150/robert-dicicco/perl/ch-2.pl @@ -0,0 +1,35 @@ +#!perl.exe + +use strict; +use warnings; +use ntheory qw/ factor /; +use 5.30.0; + +# Author: Robert DiCicco +# Date: 31-JAN-2022 +# Challenge 150 Square-Free Integer (Perl) + +my @sqfnums = (); + +foreach my $num (1..500){ + my @facs = factor($num); + my $retval = SquareFree (@facs); + if($retval > 0){ + push(@sqfnums, $num); + } +} + +say "@sqfnums "; + +sub SquareFree { + my %dvals = (); + foreach my $val (@_){ + if (! exists($dvals{$val})){ + $dvals{$val} = 1; + } else { + return -1; + } + } + + return 1; +} diff --git a/challenge-150/robert-dicicco/raku/ch-1.raku b/challenge-150/robert-dicicco/raku/ch-1.raku new file mode 100644 index 0000000000..b2694c044c --- /dev/null +++ b/challenge-150/robert-dicicco/raku/ch-1.raku @@ -0,0 +1,26 @@ +#!raku.exe + +# Author: Robert DiCicco +# Date: 01-FEB--2022 +# Challenge 150 Fibonacci Words (Raku) + +my $a = '1234'; +my $b = '5678'; + +say "Fibonacci Words"; +say $a; +say $b; + +my $retval = Fib( $a, $b ); +my $fibchr = substr($retval, 50, 1); +say "51st digit is $fibchr"; + +sub Fib ( $first, $second) { + my $val = $first ~ $second; + say $val; + if $val.chars < 51 { + Fib($second, $val); + } else { + return $val; + } +} diff --git a/challenge-150/robert-dicicco/raku/ch-2.raku b/challenge-150/robert-dicicco/raku/ch-2.raku new file mode 100644 index 0000000000..ea362a9191 --- /dev/null +++ b/challenge-150/robert-dicicco/raku/ch-2.raku @@ -0,0 +1,30 @@ +#!raku.exe + +use v6; +use Prime::Factor; + +# Author: Robert DiCicco +# Date: 01-FEB-2022 +# Challenge 150 Square-Free Integer (Raku) + +sub SquareFree { + my %dvals = (); + for @_ -> $num { + if %dvals{$num}:exists { + return False; + } else { + %dvals{$num} = 1; + } + } + + return True; +} + +my $range = 1 .. 500; +for $range.list -> $elem { + my @arr = prime-factors($elem); + my $retval = SquareFree(@arr); + if $retval { print("$elem ") }; +} + +say " "; diff --git a/challenge-150/robert-dicicco/ruby/ch-1.rb b/challenge-150/robert-dicicco/ruby/ch-1.rb new file mode 100644 index 0000000000..57459d2a14 --- /dev/null +++ b/challenge-150/robert-dicicco/ruby/ch-1.rb @@ -0,0 +1,32 @@ +#!ruby.exe + +# Author: Robert DiCicco +# Date: 31-JAN-2022 +# Challenge 150 Fibonacci Words (Ruby) + +a = '1234' +b = '5678' + +# recursive routine to create fibonacci series, but using strings + +def Fib ( first, second) + val = first + second + puts val + + # if new string length is less than 51, go another round using new combined string + if val.length < 51 then + Fib( second, val) + else + # return the string if length 51 or greater + return val + end + +end + +puts 'Fibonacci Words' +puts a +puts b + +# get the 51st character +char = Fib(a,b)[50].chr +puts "51st digit is " + char diff --git a/challenge-150/robert-dicicco/ruby/ch-2.rb b/challenge-150/robert-dicicco/ruby/ch-2.rb new file mode 100644 index 0000000000..970e737cb0 --- /dev/null +++ b/challenge-150/robert-dicicco/ruby/ch-2.rb @@ -0,0 +1,47 @@ +#!ruby.exe + +# Author: Robert DiCicco +# Date: 31-JAN-2022 +# Challenge 150 Square-Free Integer (Ruby) + +fsums = [] +LIMIT = 500 + +def factors(num) + arr = [] + (1..num).each do |f| + if num % f == 0 + arr.push(f) + end + end + + return arr +end + +def checkFactors(f) + f.each do |p| + next if p == 1 + if IsPerfectSquare(p) == true + return false + else + next + end + end + + return true +end + +def IsPerfectSquare(num) + Integer.sqrt(num) ** 2 == num +end + +(1..LIMIT).each do |num| + facarr = factors(num) + retval = checkFactors(facarr) + + if retval + fsums.push(num) + end +end + +puts "#{fsums}" diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 0fddafb9c9..db789d92d0 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,47 +1,24 @@ { - "legend" : { - "enabled" : 0 - }, - "tooltip" : { - "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", - "followPointer" : 1, - "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>" - }, "title" : { "text" : "The Weekly Challenge - 150" }, - "xAxis" : { - "type" : "category" + "subtitle" : { + "text" : "[Champions: 13] Last updated at 2022-02-02 17:14:00 GMT" }, "chart" : { "type" : "column" }, - "subtitle" : { - "text" : "[Champions: 12] Last updated at 2022-02-02 16:45:32 GMT" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - } - } + "legend" : { + "enabled" : 0 }, "series" : [ { - "colorByPoint" : 1, "name" : "The Weekly Challenge - 150", "data" : [ { "name" : "Abigail", - "drilldown" : "Abigail", - "y" : 4 + "y" : 4, + "drilldown" : "Abigail" }, { "y" : 1, @@ -49,61 +26,90 @@ "name" : "Andrew Shitov" }, { - "y" : 1, "drilldown" : "Cheok-Yin Fung", + "y" : 1, "name" : "Cheok-Yin Fung" }, { - "y" : 2, "drilldown" : "E. Choroba", + "y" : 2, "name" : "E. Choroba" }, { - "name" : "James Smith", + "y" : 3, "drilldown" : "James Smith", - "y" : 3 + "name" : "James Smith" }, { - "name" : "Luca Ferrari", + "y" : 4, "drilldown" : "Luca Ferrari", - "y" : 4 + "name" : "Luca Ferrari" }, { "drilldown" : "Mark Anderson", - "name" : "Mark Anderson", - "y" : 2 + "y" : 2, + "name" : "Mark Anderson" }, { - "y" : 2, "name" : "Marton Polgar", + "y" : 2, "drilldown" : "Marton Polgar" }, { "drilldown" : "Peter Campbell Smith", - "name" : "Peter Campbell Smith", - "y" : 3 + "y" : 3, + "name" : "Peter Campbell Smith" + }, + { + "drilldown" : "Robert DiCicco", + "y" : 4, + "name" : "Robert DiCicco" }, { - "y" : 2, "name" : "Robert Ransbottom", + "y" : 2, "drilldown" : "Robert Ransbottom" }, { "drilldown" : "Roger Bell_West", - "name" : "Roger Bell_West", - "y" : 4 + "y" : 4, + "name" : "Roger Bell_West" }, { - "name" : "W. Luis Mochan", "drilldown" : "W. Luis Mochan", - "y" : 3 + "y" : 3, + "name" : "W. Luis Mochan" } - ] + ], + "colorByPoint" : 1 } ], + "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 + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } + }, + "xAxis" : { + "type" : "category" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, "drilldown" : { "series" : [ { + "id" : "Abigail", "data" : [ [ "Perl", @@ -114,7 +120,6 @@ 2 ] ], - "id" : "Abigail", "name" : "Abigail" }, { @@ -124,8 +129,8 @@ 1 ] ], - "name" : "Andrew Shitov", - "id" : "Andrew Shitov" + "id" : "Andrew Shitov", + "name" : "Andrew Shitov" }, { "data" : [ @@ -134,17 +139,17 @@ 1 ] ], - "name" : "Cheok-Yin Fung", - "id" : "Cheok-Yin Fung" + "id" : "Cheok-Yin Fung", + "name" : "Cheok-Yin Fung" }, { + "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] ], - "id" : "E. Choroba", "name" : "E. Choroba" }, { @@ -162,8 +167,6 @@ ] }, { - "name" : "Luca Ferrari", - "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -173,29 +176,33 @@ "Blog", 2 ] - ] + ], + "id" : "Luca Ferrari", + "name" : "Luca Ferrari" }, { "id" : "Mark Anderson", - "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "Mark Anderson" }, { + "id" : "Marton Polgar", "data" : [ [ "Raku", 2 ] ], - "id" : "Marton Polgar", "name" : "Marton Polgar" }, { + "name" : "Peter Campbell Smith", + "id" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -205,13 +212,25 @@ "Blog", 1 ] - ], - "id" : "Peter Campbell Smith", - "name" : "Peter Campbell Smith" + ] + }, + { + "name" : "Robert DiCicco", + "id" : "Robert DiCicco", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ] }, { - "id" : "Robert Ransbottom", "name" : "Robert Ransbottom", + "id" : "Robert Ransbottom", "data" : [ [ "Raku", @@ -220,7 +239,6 @@ ] }, { - "name" : "Roger Bell_West", "id" : "Roger Bell_West", "data" : [ [ @@ -231,10 +249,10 @@ "Raku", 2 ] - ] + ], + "name" : "Roger Bell_West" }, { - "name" : "W. Luis Mochan", "id" : "W. Luis Mochan", "data" : [ [ @@ -245,7 +263,8 @@ "Blog", 1 ] - ] + ], + "name" : "W. Luis Mochan" } ] } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 8f3b65dd51..266128b700 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,31 +1,24 @@ { - "title" : { - "text" : "The Weekly Challenge Contributions [2019 - 2021]" - }, - "legend" : { - "enabled" : "false" - }, - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" - }, "xAxis" : { + "type" : "category", "labels" : { "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" } - }, - "type" : "category" + } }, - "chart" : { - "type" : "column" + "yAxis" : { + "min" : 0, + "title" : { + "text" : null + } }, - "subtitle" : { - "text" : "Last updated at 2022-02-02 16:45:32 GMT" + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" }, "series" : [ { - "name" : "Contributions", "data" : [ [ "Blog", @@ -33,31 +26,38 @@ ], [ "Perl", - 7209 + 7211 ], [ "Raku", - 4337 + 4339 ] ], "dataLabels" : { - "enabled" : "true", + "color" : "#FFFFFF", "format" : "{point.y:.0f}", - "y" : 10, "rotation" : -90, + "align" : "right", + "enabled" : "true", + "y" : 10, "style" : { "fontFamily" : "Verdana, sans-serif", "fontSize" : "13px" - }, - "align" : "right", - "color" : "#FFFFFF" - } + } + }, + "name" : "Contributions" } ], - "yAxis" : { - "min" : 0, - "title" : { - "text" : null - } + "legend" : { + "enabled" : "false" + }, + "chart" : { + "type" : "column" + }, + "subtitle" : { + "text" : "Last updated at 2022-02-02 17:14:00 GMT" + }, + "title" : { + "text" : "The Weekly Challenge Contributions [2019 - 2021]" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index ce04f40684..9c04c8fab3 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -2,6 +2,7 @@ "drilldown" : { "series" : [ { + "name" : "001", "data" : [ [ "Perl", @@ -16,12 +17,9 @@ 11 ] ], - "name" : "001", "id" : "001" }, { - "id" : "002", - "name" : "002", "data" : [ [ "Perl", @@ -35,9 +33,13 @@ "Blog", 10 ] - ] + ], + "id" : "002", + "name" : "002" }, { + "name" : "003", + "id" : "003", "data" : [ [ "Perl", @@ -51,13 +53,10 @@ "Blog", 9 ] - ], - "id" : "003", - "name" : "003" + ] }, { "id" : "004", - "name" : "004", "data" : [ [ "Perl", @@ -71,9 +70,12 @@ "Blog", 10 ] - ] + ], + "name" : "004" }, { + "name" : "005", + "id" : "005", "data" : [ [ "Perl", @@ -87,9 +89,7 @@ "Blog", 12 ] - ], - "name" : "005", - "id" : "005" + ] }, { "data" : [ @@ -106,12 +106,11 @@ 7 ] ], - "name" : "006", - "id" : "006" + "id" : "006", + "name" : "006" }, { "id" : "007", - "name" : "007", "data" : [ [ "Perl", @@ -125,7 +124,8 @@ "Blog", 10 ] - ] + ], + "name" : "007" }, { "data" : [ @@ -146,6 +146,7 @@ "name" : "008" }, { + "id" : "009", "data" : [ [ "Perl", @@ -160,8 +161,7 @@ 13 ] ], - "name" : "009", - "id" : "009" + "name" : "009" }, { "data" : [ @@ -178,10 +178,11 @@ 11 ] ], - "name" : "010", - "id" : "010" + "id" : "010", + "name" : "010" }, { + "id" : "011", "data" : [ [ "Perl", @@ -196,12 +197,9 @@ 10 ] ], - "name" : "011", - "id" : "011" + "name" : "011" }, { - "id" : "012", - "name" : "012", "data" : [ [ "Perl", @@ -215,9 +213,13 @@ "Blog", 11 ] - ] + ], + "id" : "012", + "name" : "012" }, { + "name" : "013", + "id" : "013", "data" : [ [ "Perl", @@ -231,12 +233,9 @@ "Blog", 13 ] - ], - "id" : "013", - "name" : "013" + ] }, { - "id" : "014", "name" : "014", "data" : [ [ @@ -251,9 +250,11 @@ "Blog", 15 ] - ] + ], + "id" : "014" }, { + "name" : "015", "data" : [ [ "Perl", @@ -268,12 +269,10 @@ 15 ] ], - "name" : "015", "id" : "015" }, { "name" : "016", - "id" : "016", "data" : [ [ "Perl", @@ -287,9 +286,12 @@ "Blog", 12 ] - ] + ], + "id" : "016" }, { + "name" : "017", + "id" : "017", "data" : [ [ "Perl", @@ -303,13 +305,10 @@ "Blog", 12 ] - ], - "name" : "017", - "id" : "017" + ] }, { "name" : "018", - "id" : "018", "data" : [ [ "Perl", @@ -323,10 +322,10 @@ "Blog", 14 ] - ] + ], + "id" : "018" }, { - "name" : "019", "id" : "019", "data" : [ [ @@ -341,11 +340,12 @@ "Blog", 13 ] - ] + ], + "name" : "019" }, { - "id" : "020", "name" : "020", + "id" : "020", "data" : [ [ "Perl", @@ -362,8 +362,6 @@ ] }, { - "id" : "021", - "name" : "021", "data" : [ [ "Perl", @@ -377,7 +375,9 @@ "Blog", 10 ] - ] + ], + "id" : "021", + "name" : "021" }, { "data" : [ @@ -394,10 +394,11 @@ 10 ] ], - "name" : "022", - "id" : "022" + "id" : "022", + "name" : "022" }, { + "name" : "023", "data" : [ [ "Perl", @@ -412,7 +413,6 @@ 12 ] ], - "name" : "023", "id" : "023" }, { @@ -434,6 +434,7 @@ ] }, { + "name" : "025", "data" : [ [ "Perl", @@ -448,10 +449,10 @@ 12 ] ], - "name" : "025", "id" : "025" }, { + "id" : "026", "data" : [ [ "Perl", @@ -466,10 +467,11 @@ 10 ] ], - "id" : "026", "name" : "026" }, { + "name" : "027", + "id" : "027", "data" : [ [ "Perl", @@ -483,11 +485,10 @@ "Blog", 9 ] - ], - "id" : "027", - "name" : "027" + ] }, { + "name" : "028", "data" : [ [ "Perl", @@ -502,11 +503,9 @@ 9 ] ], - "name" : "028", "id" : "028" }, { - "id" : "029", "name" : "029", "data" : [ [ @@ -521,11 +520,11 @@ "Blog", 12 ] - ] + ], + "id" : "029" }, { "id" : "030", - "name" : "030", "data" : [ [ "Perl", @@ -539,10 +538,10 @@ "Blog", 10 ] - ] + ], + "name" : "030" }, { - "id" : "031", "name" : "031", "data" : [ [ @@ -557,9 +556,11 @@ "Blog", 9 ] - ] + ], + "id" : "031" }, { + "id" : "032", "data" : [ [ "Perl", @@ -574,8 +575,7 @@ 10 ] ], - "name" : "032", - "id" : "032" + "name" : "032" }, { "data" : [ @@ -592,11 +592,10 @@ 10 ] ], - "name" : "033", - "id" : "033" + "id" : "033", + "name" : "033" }, { - "id" : "034", "name" : "034", "data" : [ [ @@ -611,9 +610,11 @@ "Blog", 11 ] - ] + ], + "id" : "034" }, { + "name" : "035", "data" : [ [ "Perl", @@ -628,10 +629,10 @@ 9 ] ], - "id" : "035", - "name" : "035" + "id" : "035" }, { + "name" : "036", "data" : [ [ "Perl", @@ -646,10 +647,10 @@ 11 ] ], - "id" : "036", - "name" : "036" + "id" : "036" }, { + "name" : "037", "data" : [ [ "Perl", @@ -664,11 +665,9 @@ 9 ] ], - "id" : "037", - "name" : "037" + "id" : "037" }, { - "id" : "038", "name" : "038", "data" : [ [ @@ -683,11 +682,11 @@ "Blog", 12 ] - ] + ], + "id" : "038" }, { |
