diff options
| -rw-r--r-- | challenge-167/ulrich-rieke/haskell/ch-1.hs | 26 | ||||
| -rw-r--r-- | challenge-167/ulrich-rieke/raku/ch-1.raku | 27 | ||||
| -rw-r--r-- | stats/pwc-current.json | 159 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 42 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 1118 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 712 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 118 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 32 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 114 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 38 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 100 | ||||
| -rw-r--r-- | stats/pwc-summary-241-270.json | 94 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 30 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 36 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 42 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 568 |
16 files changed, 1664 insertions, 1592 deletions
diff --git a/challenge-167/ulrich-rieke/haskell/ch-1.hs b/challenge-167/ulrich-rieke/haskell/ch-1.hs new file mode 100644 index 0000000000..b54ca89ec9 --- /dev/null +++ b/challenge-167/ulrich-rieke/haskell/ch-1.hs @@ -0,0 +1,26 @@ +module Challenge167 + where + +isPrime :: Int -> Bool +isPrime n + |n == 2 = True + |n == 1 = False + |otherwise = null $ filter (\i -> mod n i == 0 ) [2 .. root] + where + root :: Int + root = floor $ sqrt $ fromIntegral n + +findCycle :: Int -> [Int] +findCycle n = (takeWhile (/= n ) $ iterate step ( step n )) ++ [n] +where + step :: Int -> Int + step d = read ( tail s ++ [head s] ) + where + s = show d + +solution :: [Int] +solution = take 10 $ filter (\i -> (noNull i ) && ( all (\d -> isPrime d +&& d >= i ) $ findCycle i )) [100 , 101 ..] + where + noNull :: Int -> Bool + noNull d = not ( elem '0' $ show d ) diff --git a/challenge-167/ulrich-rieke/raku/ch-1.raku b/challenge-167/ulrich-rieke/raku/ch-1.raku new file mode 100644 index 0000000000..607adff4f5 --- /dev/null +++ b/challenge-167/ulrich-rieke/raku/ch-1.raku @@ -0,0 +1,27 @@ +use v6 ; + +sub findCycles( Int $n is copy ) { + my $numberstring = ~$n ; + my @cycle ; + my $rotated = $numberstring.substr( 1 ) ~ $numberstring.substr( 0 , 1 ) ; + @cycle.push( +$rotated ) ; + while ( $rotated ne $numberstring ) { + $rotated = $rotated.substr( 1 ) ~ $rotated.substr(0 , 1 ) ; + @cycle.push( +$rotated ) ; + } + return @cycle ; +} + +my @circularPrimes ; +my $current = 100 ; +while ( @circularPrimes.elems != 10 ) { + if ( ~$current !~~ /0/ ) { + my @cycle = findCycles( $current ) ; + my @selected = grep ( { $_ >= $current } ) , @cycle ; + if ( (so is-prime @cycle.all) && (@selected.elems == @cycle.elems) ) { + @circularPrimes.push( $current ) ; + } + } + $current++ ; +} +say @circularPrimes.join( ', ' ) ; diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 791e5ee4b0..7c87c4931d 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,36 +1,68 @@ { + "plotOptions" : { + "series" : { + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + }, + "borderWidth" : 0 + } + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, "legend" : { "enabled" : 0 }, + "xAxis" : { + "type" : "category" + }, + "chart" : { + "type" : "column" + }, + "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/>" + }, + "subtitle" : { + "text" : "[Champions: 14] Last updated at 2022-06-04 02:08:41 GMT" + }, "series" : [ { - "name" : "The Weekly Challenge - 167", "colorByPoint" : 1, "data" : [ { + "name" : "Dave Jacoby", "drilldown" : "Dave Jacoby", - "y" : 2, - "name" : "Dave Jacoby" + "y" : 2 }, { - "drilldown" : "James Smith", "y" : 3, - "name" : "James Smith" + "name" : "James Smith", + "drilldown" : "James Smith" }, { + "drilldown" : "Jorg Sommrey", "name" : "Jorg Sommrey", - "y" : 2, - "drilldown" : "Jorg Sommrey" + "y" : 2 }, { + "name" : "Laurent Rosenfeld", "drilldown" : "Laurent Rosenfeld", - "y" : 4, - "name" : "Laurent Rosenfeld" + "y" : 4 + }, + { + "drilldown" : "Lubos Kolouch", + "name" : "Lubos Kolouch", + "y" : 1 }, { "name" : "Luca Ferrari", - "y" : 6, - "drilldown" : "Luca Ferrari" + "drilldown" : "Luca Ferrari", + "y" : 6 }, { "drilldown" : "Mark Anderson", @@ -44,50 +76,41 @@ }, { "drilldown" : "Peter Campbell Smith", - "y" : 3, - "name" : "Peter Campbell Smith" + "name" : "Peter Campbell Smith", + "y" : 3 }, { - "name" : "Robert Ransbottom", "y" : 2, + "name" : "Robert Ransbottom", "drilldown" : "Robert Ransbottom" }, { - "y" : 5, + "drilldown" : "Roger Bell_West", "name" : "Roger Bell_West", - "drilldown" : "Roger Bell_West" + "y" : 5 }, { - "y" : 4, + "drilldown" : "Ryan Thompson", "name" : "Ryan Thompson", - "drilldown" : "Ryan Thompson" + "y" : 4 }, { - "drilldown" : "Ulrich Rieke", "name" : "Ulrich Rieke", - "y" : 1 + "drilldown" : "Ulrich Rieke", + "y" : 2 }, { - "y" : 3, "name" : "W. Luis Mochan", - "drilldown" : "W. Luis Mochan" + "drilldown" : "W. Luis Mochan", + "y" : 3 } - ] + ], + "name" : "The Weekly Challenge - 167" } ], - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - } - } - }, "drilldown" : { "series" : [ { - "name" : "Dave Jacoby", "id" : "Dave Jacoby", "data" : [ [ @@ -98,11 +121,12 @@ "Blog", 1 ] - ] + ], + "name" : "Dave Jacoby" }, { - "name" : "James Smith", "id" : "James Smith", + "name" : "James Smith", "data" : [ [ "Perl", @@ -115,16 +139,17 @@ ] }, { - "name" : "Jorg Sommrey", "data" : [ [ "Perl", 2 ] ], + "name" : "Jorg Sommrey", "id" : "Jorg Sommrey" }, { + "name" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -139,11 +164,19 @@ 1 ] ], - "id" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld" + "id" : "Laurent Rosenfeld" + }, + { + "id" : "Lubos Kolouch", + "name" : "Lubos Kolouch", + "data" : [ + [ + "Perl", + 1 + ] + ] }, { - "name" : "Luca Ferrari", "data" : [ [ "Raku", @@ -154,21 +187,22 @@ 4 ] ], + "name" : "Luca Ferrari", "id" : "Luca Ferrari" }, { - "name" : "Mark Anderson", + "id" : "Mark Anderson", "data" : [ [ "Raku", 2 ] ], - "id" : "Mark Anderson" + "name" : "Mark Anderson" }, { - "name" : "Niels van Dijke", "id" : "Niels van Dijke", + "name" : "Niels van Dijke", "data" : [ [ "Perl", @@ -177,7 +211,6 @@ ] }, { - "id" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -188,11 +221,12 @@ 1 ] ], - "name" : "Peter Campbell Smith" + "name" : "Peter Campbell Smith", + "id" : "Peter Campbell Smith" }, { - "name" : "Robert Ransbottom", "id" : "Robert Ransbottom", + "name" : "Robert Ransbottom", "data" : [ [ "Raku", @@ -220,6 +254,7 @@ }, { "id" : "Ryan Thompson", + "name" : "Ryan Thompson", "data" : [ [ "Perl", @@ -229,20 +264,24 @@ "Blog", 2 ] - ], - "name" : "Ryan Thompson" + ] }, { - "name" : "Ulrich Rieke", "id" : "Ulrich Rieke", "data" : [ [ "Perl", 1 + ], + [ + "Raku", + 1 ] - ] + ], + "name" : "Ulrich Rieke" }, { + "name" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -253,30 +292,10 @@ 1 ] ], - "id" : "W. Luis Mochan", - "name" : "W. Luis Mochan" + "id" : "W. Luis Mochan" } ] }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "xAxis" : { - "type" : "category" - }, - "subtitle" : { - "text" : "[Champions: 13] Last updated at 2022-06-03 14:51:05 GMT" - }, - "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/>" - }, - "chart" : { - "type" : "column" - }, "title" : { "text" : "The Weekly Challenge - 167" } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 516d9f7886..929e5da693 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,9 +1,9 @@ { - "yAxis" : { - "min" : 0, - "title" : { - "text" : null - } + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" }, "xAxis" : { "labels" : { @@ -14,20 +14,20 @@ }, "type" : "category" }, - "subtitle" : { - "text" : "Last updated at 2022-06-03 14:51:05 GMT" + "yAxis" : { + "min" : 0, + "title" : { + "text" : null + } }, - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" + "legend" : { + "enabled" : "false" }, "title" : { "text" : "The Weekly Challenge Contributions [2019 - 2022]" }, - "chart" : { - "type" : "column" - }, - "legend" : { - "enabled" : "false" + "subtitle" : { + "text" : "Last updated at 2022-06-04 02:08:41 GMT" }, "series" : [ { @@ -37,12 +37,12 @@ "fontFamily" : "Verdana, sans-serif", "fontSize" : "13px" }, - "color" : "#FFFFFF", - "y" : 10, - "format" : "{point.y:.0f}", - "align" : "right", + "enabled" : "true", "rotation" : -90, - "enabled" : "true" + "align" : "right", + "format" : "{point.y:.0f}", + "y" : 10, + "color" : "#FFFFFF" }, "data" : [ [ @@ -51,11 +51,11 @@ ], [ "Perl", - 8136 + 8137 ], [ "Raku", - 4817 + 4818 ] ] } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index bc64281f42..9ba080aaff 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,39 +1,10 @@ { - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2022-06-03 14:51:05 GMT" - }, - "tooltip" : { - "followPointer" : "true", - "headerFormat" : "<span style=\"font-size:11px\"></span>", - "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>" - }, - "xAxis" : { - "type" : "category" - }, "title" : { "text" : "The Weekly Challenge Language" }, - "chart" : { - "type" : "column" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, "drilldown" : { "series" : [ { - "name" : "001", "id" : "001", "data" : [ [ @@ -48,10 +19,10 @@ "Blog", 11 ] - ] + ], + "name" : "001" }, { - "id" : "002", "data" : [ [ "Perl", @@ -66,11 +37,12 @@ 10 ] ], - "name" : "002" + "name" : "002", + "id" : "002" }, { - "name" : "003", "id" : "003", + "name" : "003", "data" : [ [ "Perl", @@ -88,7 +60,6 @@ }, { "name" : "004", - "id" : "004", "data" : [ [ "Perl", @@ -102,10 +73,11 @@ "Blog", 10 ] - ] + ], + "id" : "004" }, { - "name" : "005", + "id" : "005", "data" : [ [ "Perl", @@ -120,10 +92,9 @@ 12 ] ], - "id" : "005" + "name" : "005" }, { - "name" : "006", "data" : [ [ "Perl", @@ -138,6 +109,7 @@ 7 ] ], + "name" : "006", "id" : "006" }, { @@ -159,6 +131,8 @@ "name" : "007" }, { + "id" : "008", + "name" : "008", "data" : [ [ "Perl", @@ -172,12 +146,10 @@ "Blog", 12 ] - ], - "id" : "008", - "name" : "008" + ] }, { - "id" : "009", + "name" : "009", "data" : [ [ "Perl", @@ -192,9 +164,11 @@ 13 ] ], - "name" : "009" + "id" : "009" }, { + "id" : "010", + "name" : "010", "data" : [ [ "Perl", @@ -208,11 +182,11 @@ "Blog", 11 ] - ], - "id" : "010", - "name" : "010" + ] }, { + "id" : "011", + "name" : "011", "data" : [ [ "Perl", @@ -226,12 +200,10 @@ "Blog", 10 ] - ], - "id" : "011", - "name" : "011" + ] }, { - "name" : "012", + "id" : "012", "data" : [ [ "Perl", @@ -246,7 +218,7 @@ 11 ] ], - "id" : "012" + "name" : "012" }, { "name" : "013", @@ -267,8 +239,6 @@ "id" : "013" }, { - "name" : "014", - "id" : "014", "data" : [ [ "Perl", @@ -282,11 +252,13 @@ "Blog", 15 ] - ] + ], + "name" : "014", + "id" : "014" }, { - "name" : "015", "id" : "015", + "name" : "015", "data" : [ [ "Perl", @@ -321,7 +293,7 @@ "name" : "016" }, { - "name" : "017", + "id" : "017", "data" : [ [ "Perl", @@ -336,9 +308,10 @@ 12 ] ], - "id" : "017" + "name" : "017" }, { + "id" : "018", "name" : "018", "data" : [ [ @@ -353,12 +326,11 @@ "Blog", 14 ] - ], - "id" : "018" + ] }, { - "name" : "019", "id" : "019", + "name" : "019", "data" : [ [ "Perl", @@ -375,6 +347,8 @@ ] }, { + "id" : "020", + "name" : "020", "data" : [ [ "Perl", @@ -388,11 +362,10 @@ "Blog", 13 ] - ], - "id" : "020", - "name" : "020" + ] }, { + "id" : "021", "data" : [ [ "Perl", @@ -407,10 +380,10 @@ 10 ] ], - "id" : "021", "name" : "021" }, { + "name" : "022", "data" : [ [ "Perl", @@ -425,11 +398,9 @@ 10 ] ], - "id" : "022", - "name" : "022" + "id" : "022" }, { - "name" : "023", "id" : "023", "data" : [ [ @@ -444,10 +415,11 @@ "Blog", 12 ] - ] + ], + "name" : "023" }, { - "name" : "024", + "id" : "024", "data" : [ [ "Perl", @@ -462,9 +434,10 @@ 11 ] ], - "id" : "024" + "name" : "024" }, { + "id" : "025", "name" : "025", "data" : [ [ @@ -479,10 +452,10 @@ "Blog", 12 ] - ], - "id" : "025" + ] }, { + "id" : "026", "name" : "026", "data" : [ [ @@ -497,10 +470,10 @@ "Blog", 10 ] - ], - "id" : "026" + ] }, { + "id" : "027", "data" : [ [ "Perl", @@ -515,11 +488,9 @@ 9 ] ], - "id" : "027", "name" : "027" }, { - "id" : "028", "data" : [ [ "Perl", @@ -534,7 +505,8 @@ 9 ] ], - "name" : "028" + "name" : "028", + "id" : "028" }, { "id" : "029", @@ -555,6 +527,7 @@ "name" : "029" }, { + "name" : "030", "data" : [ [ "Perl", @@ -569,12 +542,9 @@ 10 ] ], - "id" : "030", - "name" : "030" + "id" : "030" }, { - "name" : "031", - "id" : "031", "data" : [ [ "Perl", @@ -588,10 +558,13 @@ "Blog", 9 ] - ] + ], + "name" : "031", + "id" : "031" }, { "id" : "032", + "name" : "032", "data" : [ [ "Perl", @@ -605,11 +578,11 @@ "Blog", 10 ] - ], - "name" : "032" + ] }, { "id" : "033", + "name" : "033", "data" : [ [ "Perl", @@ -623,11 +596,10 @@ "Blog", 10 ] - ], - "name" : "033" + ] }, { - "id" : "034", + "name" : "034", "data" : [ [ "Perl", @@ -642,11 +614,9 @@ 11 ] ], - "name" : "034" + "id" : "034" }, { - "name" : "035", - "id" : "035", "data" : [ [ "Perl", @@ -660,10 +630,12 @@ "Blog", 9 ] - ] + ], + "name" : "035", + "id" : "035" }, { - "id" : "036", + "name" : "036", "data" : [ [ "Perl", @@ -678,7 +650,7 @@ 11 ] ], - "name" : "036" + "id" : "036" }, { "data" : [ @@ -695,10 +667,11 @@ 9 ] ], - "id" : "037", - "name" : "037" + "name" : "037", + "id" : "037" }, { + "name" : "038", "data" : [ [ "Perl", @@ -713,11 +686,9 @@ 12 ] ], - "id" : "038", - "name" : "038" + "id" : "038" }, { - "name" : "039", "id" : "039", "data" : [ [ @@ -732,10 +703,10 @@ "Blog", 12 ] - ] + ], + "name" : "039" }, { - "name" : "040", "data" : [ [ "Perl", @@ -750,11 +721,10 @@ 10 ] ], + "name" : "040", "id" : "040" }, { - "name" : "041", - "id" : "041", "data" : [ [ "Perl", @@ -768,10 +738,11 @@ "Blog", 9 ] - ] + ], + "name" : "041", + "id" : "041" }, { - "name" : "042", "data" : [ [ "Perl", @@ -786,9 +757,11 @@ 11 ] ], + "name" : "042", "id" : "042" }, { + "id" : "043", "name" : "043", "data" : [ [ @@ -803,10 +776,11 @@ "Blog", 11 ] - ], - "id" : "043" + ] }, { + "id" : "044", + "name" : "044", "data" : [ [ "Perl", @@ -820,11 +794,11 @@ "Blog", 11 ] - ], - "id" : "044", - "name" : "044" + ] }, { + "id" : "045", + "name" : "045", "data" : [ [ "Perl", @@ -838,9 +812,7 @@ "Blog", 11 ] - ], - "id" : "045", - "name" : "045" + ] }, { "id" : "046", @@ -861,8 +833,8 @@ "name" : "046" }, { - "name" : "047", "id" : "047", + "name" : "047", "data" : [ [ "Perl", @@ -880,6 +852,7 @@ }, { "id" : "048", + "name" : "048", "data" : [ [ "Perl", @@ -893,8 +866,7 @@ "Blog", 12 ] - ], - "name" : "048" + ] }, { "name" : "049", @@ -915,6 +887,7 @@ "id" : "049" }, { + "id" : "050", "data" : [ [ "Perl", @@ -929,11 +902,10 @@ 12 ] ], - "id" : "050", "name" : "050" }, { - "id" : "051", + "name" : "051", "data" : [ [ "Perl", @@ -948,7 +920,7 @@ 11 ] ], - "name" : "051" + "id" : "051" }, { "name" : "052", @@ -969,6 +941,7 @@ "id" : "052" }, { + "id" : "053", "data" : [ [ "Perl", @@ -983,10 +956,10 @@ 15 ] ], - "id" : "053", "name" : "053" }, { + "name" : "054", |
