aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2022-06-04 03:10:20 +0100
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2022-06-04 03:10:20 +0100
commit7bcf2d3292c4a1bfc064ddbb7c6806248e243ef4 (patch)
treef94008cf9791e97dd910493218c2bf754f48a24f
parent8e5a4c3795924e266b130e60511d3a5fea54eb77 (diff)
downloadperlweeklychallenge-club-7bcf2d3292c4a1bfc064ddbb7c6806248e243ef4.tar.gz
perlweeklychallenge-club-7bcf2d3292c4a1bfc064ddbb7c6806248e243ef4.tar.bz2
perlweeklychallenge-club-7bcf2d3292c4a1bfc064ddbb7c6806248e243ef4.zip
- Added solution by Ulrich Rieke.
-rw-r--r--challenge-167/ulrich-rieke/haskell/ch-1.hs26
-rw-r--r--challenge-167/ulrich-rieke/raku/ch-1.raku27
-rw-r--r--stats/pwc-current.json252
-rw-r--r--stats/pwc-language-breakdown-summary.json52
-rw-r--r--stats/pwc-language-breakdown.json1048
-rw-r--r--stats/pwc-leaders.json384
-rw-r--r--stats/pwc-summary-1-30.json100
-rw-r--r--stats/pwc-summary-121-150.json46
-rw-r--r--stats/pwc-summary-151-180.json34
-rw-r--r--stats/pwc-summary-181-210.json110
-rw-r--r--stats/pwc-summary-211-240.json38
-rw-r--r--stats/pwc-summary-241-270.json86
-rw-r--r--stats/pwc-summary-31-60.json32
-rw-r--r--stats/pwc-summary-61-90.json106
-rw-r--r--stats/pwc-summary-91-120.json120
-rw-r--r--stats/pwc-summary.json32
16 files changed, 1275 insertions, 1218 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 7d306218ab..7c87c4931d 100644
--- a/stats/pwc-current.json
+++ b/stats/pwc-current.json
@@ -1,8 +1,117 @@
{
+ "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" : [
+ {
+ "colorByPoint" : 1,
+ "data" : [
+ {
+ "name" : "Dave Jacoby",
+ "drilldown" : "Dave Jacoby",
+ "y" : 2
+ },
+ {
+ "y" : 3,
+ "name" : "James Smith",
+ "drilldown" : "James Smith"
+ },
+ {
+ "drilldown" : "Jorg Sommrey",
+ "name" : "Jorg Sommrey",
+ "y" : 2
+ },
+ {
+ "name" : "Laurent Rosenfeld",
+ "drilldown" : "Laurent Rosenfeld",
+ "y" : 4
+ },
+ {
+ "drilldown" : "Lubos Kolouch",
+ "name" : "Lubos Kolouch",
+ "y" : 1
+ },
+ {
+ "name" : "Luca Ferrari",
+ "drilldown" : "Luca Ferrari",
+ "y" : 6
+ },
+ {
+ "drilldown" : "Mark Anderson",
+ "name" : "Mark Anderson",
+ "y" : 2
+ },
+ {
+ "y" : 1,
+ "name" : "Niels van Dijke",
+ "drilldown" : "Niels van Dijke"
+ },
+ {
+ "drilldown" : "Peter Campbell Smith",
+ "name" : "Peter Campbell Smith",
+ "y" : 3
+ },
+ {
+ "y" : 2,
+ "name" : "Robert Ransbottom",
+ "drilldown" : "Robert Ransbottom"
+ },
+ {
+ "drilldown" : "Roger Bell_West",
+ "name" : "Roger Bell_West",
+ "y" : 5
+ },
+ {
+ "drilldown" : "Ryan Thompson",
+ "name" : "Ryan Thompson",
+ "y" : 4
+ },
+ {
+ "name" : "Ulrich Rieke",
+ "drilldown" : "Ulrich Rieke",
+ "y" : 2
+ },
+ {
+ "name" : "W. Luis Mochan",
+ "drilldown" : "W. Luis Mochan",
+ "y" : 3
+ }
+ ],
+ "name" : "The Weekly Challenge - 167"
+ }
+ ],
"drilldown" : {
"series" : [
{
- "name" : "Dave Jacoby",
+ "id" : "Dave Jacoby",
"data" : [
[
"Perl",
@@ -13,7 +122,7 @@
1
]
],
- "id" : "Dave Jacoby"
+ "name" : "Dave Jacoby"
},
{
"id" : "James Smith",
@@ -40,7 +149,7 @@
"id" : "Jorg Sommrey"
},
{
- "id" : "Laurent Rosenfeld",
+ "name" : "Laurent Rosenfeld",
"data" : [
[
"Perl",
@@ -55,7 +164,7 @@
1
]
],
- "name" : "Laurent Rosenfeld"
+ "id" : "Laurent Rosenfeld"
},
{
"id" : "Lubos Kolouch",
@@ -102,7 +211,6 @@
]
},
{
- "id" : "Peter Campbell Smith",
"data" : [
[
"Perl",
@@ -113,7 +221,8 @@
1
]
],
- "name" : "Peter Campbell Smith"
+ "name" : "Peter Campbell Smith",
+ "id" : "Peter Campbell Smith"
},
{
"id" : "Robert Ransbottom",
@@ -127,7 +236,6 @@
},
{
"id" : "Roger Bell_West",
- "name" : "Roger Bell_West",
"data" : [
[
"Perl",
@@ -141,9 +249,12 @@
"Blog",
1
]
- ]
+ ],
+ "name" : "Roger Bell_West"
},
{
+ "id" : "Ryan Thompson",
+ "name" : "Ryan Thompson",
"data" : [
[
"Perl",
@@ -153,22 +264,24 @@
"Blog",
2
]
- ],
- "name" : "Ryan Thompson",
- "id" : "Ryan Thompson"
+ ]
},
{
"id" : "Ulrich Rieke",
- "name" : "Ulrich Rieke",
"data" : [
[
"Perl",
1
+ ],
+ [
+ "Raku",
+ 1
]
- ]
+ ],
+ "name" : "Ulrich Rieke"
},
{
- "id" : "W. Luis Mochan",
+ "name" : "W. Luis Mochan",
"data" : [
[
"Perl",
@@ -179,120 +292,11 @@
1
]
],
- "name" : "W. Luis Mochan"
+ "id" : "W. Luis Mochan"
}
]
},
- "subtitle" : {
- "text" : "[Champions: 14] Last updated at 2022-06-03 23:27:26 GMT"
- },
- "series" : [
- {
- "name" : "The Weekly Challenge - 167",
- "data" : [
- {
- "y" : 2,
- "drilldown" : "Dave Jacoby",
- "name" : "Dave Jacoby"
- },
- {
- "drilldown" : "James Smith",
- "y" : 3,
- "name" : "James Smith"
- },
- {
- "drilldown" : "Jorg Sommrey",
- "y" : 2,
- "name" : "Jorg Sommrey"
- },
- {
- "drilldown" : "Laurent Rosenfeld",
- "y" : 4,
- "name" : "Laurent Rosenfeld"
- },
- {
- "y" : 1,
- "drilldown" : "Lubos Kolouch",
- "name" : "Lubos Kolouch"
- },
- {
- "name" : "Luca Ferrari",
- "drilldown" : "Luca Ferrari",
- "y" : 6
- },
- {
- "name" : "Mark Anderson",
- "y" : 2,
- "drilldown" : "Mark Anderson"
- },
- {
- "y" : 1,
- "drilldown" : "Niels van Dijke",
- "name" : "Niels van Dijke"
- },
- {
- "name" : "Peter Campbell Smith",
- "y" : 3,
- "drilldown" : "Peter Campbell Smith"
- },
- {
- "name" : "Robert Ransbottom",
- "drilldown" : "Robert Ransbottom",
- "y" : 2
- },
- {
- "name" : "Roger Bell_West",
- "drilldown" : "Roger Bell_West",
- "y" : 5
- },
- {
- "name" : "Ryan Thompson",
- "y" : 4,
- "drilldown" : "Ryan Thompson"
- },
- {
- "name" : "Ulrich Rieke",
- "y" : 1,
- "drilldown" : "Ulrich Rieke"
- },
- {
- "name" : "W. Luis Mochan",
- "drilldown" : "W. Luis Mochan",
- "y" : 3
- }
- ],
- "colorByPoint" : 1
- }
- ],
- "plotOptions" : {
- "series" : {
- "borderWidth" : 0,
- "dataLabels" : {
- "format" : "{point.y}",
- "enabled" : 1
- }
- }
- },
"title" : {
"text" : "The Weekly Challenge - 167"
- },
- "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/>"
- },
- "yAxis" : {
- "title" : {
- "text" : "Total Solutions"
- }
- },
- "legend" : {
- "enabled" : 0
- },
- "xAxis" : {
- "type" : "category"
- },
- "chart" : {
- "type" : "column"
}
}
diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json
index 47bac7d632..929e5da693 100644
--- a/stats/pwc-language-breakdown-summary.json
+++ b/stats/pwc-language-breakdown-summary.json
@@ -1,46 +1,49 @@
{
- "yAxis" : {
- "min" : 0,
- "title" : {
- "text" : null
- }
+ "chart" : {
+ "type" : "column"
},
"tooltip" : {
"pointFormat" : "<b>{point.y:.0f}</b>"
},
- "title" : {
- "text" : "The Weekly Challenge Contributions [2019 - 2022]"
- },
- "chart" : {
- "type" : "column"
- },
"xAxis" : {
"labels" : {
"style" : {
- "fontFamily" : "Verdana, sans-serif",
- "fontSize" : "13px"
+ "fontSize" : "13px",
+ "fontFamily" : "Verdana, sans-serif"
}
},
"type" : "category"
},
+ "yAxis" : {
+ "min" : 0,
+ "title" : {
+ "text" : null
+ }
+ },
"legend" : {
"enabled" : "false"
},
+ "title" : {
+ "text" : "The Weekly Challenge Contributions [2019 - 2022]"
+ },
+ "subtitle" : {
+ "text" : "Last updated at 2022-06-04 02:08:41 GMT"
+ },
"series" : [
{
+ "name" : "Contributions",
"dataLabels" : {
- "rotation" : -90,
- "y" : 10,
- "align" : "right",
- "enabled" : "true",
- "format" : "{point.y:.0f}",
- "color" : "#FFFFFF",
"style" : {
"fontFamily" : "Verdana, sans-serif",
"fontSize" : "13px"
- }
+ },
+ "enabled" : "true",
+ "rotation" : -90,
+ "align" : "right",
+ "format" : "{point.y:.0f}",
+ "y" : 10,
+ "color" : "#FFFFFF"
},
- "name" : "Contributions",
"data" : [
[
"Blog",
@@ -52,12 +55,9 @@
],
[
"Raku",
- 4817
+ 4818
]
]
}
- ],
- "subtitle" : {
- "text" : "Last updated at 2022-06-03 23:27:26 GMT"
- }
+ ]
}
diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json
index 2315c6a72a..9ba080aaff 100644
--- a/stats/pwc-language-breakdown.json
+++ b/stats/pwc-language-breakdown.json
@@ -1,4 +1,7 @@
{
+ "title" : {
+ "text" : "The Weekly Challenge Language"
+ },
"drilldown" : {
"series" : [
{
@@ -20,8 +23,6 @@
"name" : "001"
},
{
- "id" : "002",
- "name" : "002",
"data" : [
[
"Perl",
@@ -35,9 +36,12 @@
"Blog",
10
]
- ]
+ ],
+ "name" : "002",
+ "id" : "002"
},
{
+ "id" : "003",
"name" : "003",
"data" : [
[
@@ -52,10 +56,10 @@
"Blog",
9
]
- ],
- "id" : "003"
+ ]
},
{
+ "name" : "004",
"data" : [
[
"Perl",
@@ -70,10 +74,10 @@
10
]
],
- "name" : "004",
"id" : "004"
},
{
+ "id" : "005",
"data" : [
[
"Perl",
@@ -88,8 +92,7 @@
12
]
],
- "name" : "005",
- "id" : "005"
+ "name" : "005"
},
{
"data" : [
@@ -111,7 +114,6 @@
},
{
"id" : "007",
- "name" : "007",
"data" : [
[
"Perl",
@@ -125,9 +127,12 @@
"Blog",
10
]
- ]
+ ],
+ "name" : "007"
},
{
+ "id" : "008",
+ "name" : "008",
"data" : [
[
"Perl",
@@ -141,12 +146,9 @@
"Blog",
12
]
- ],
- "name" : "008",
- "id" : "008"
+ ]
},
{
- "id" : "009",
"name" : "009",
"data" : [
[
@@ -161,9 +163,12 @@
"Blog",
13
]
- ]
+ ],
+ "id" : "009"
},
{
+ "id" : "010",
+ "name" : "010",
"data" : [
[
"Perl",
@@ -177,11 +182,11 @@
"Blog",
11
]
- ],
- "name" : "010",
- "id" : "010"
+ ]
},
{
+ "id" : "011",
+ "name" : "011",
"data" : [
[
"Perl",
@@ -195,12 +200,10 @@
"Blog",
10
]
- ],
- "name" : "011",
- "id" : "011"
+ ]
},
{
- "name" : "012",
+ "id" : "012",
"data" : [
[
"Perl",
@@ -215,7 +218,7 @@
11
]
],
- "id" : "012"
+ "name" : "012"
},
{
"name" : "013",
@@ -236,7 +239,6 @@
"id" : "013"
},
{
- "id" : "014",
"data" : [
[
"Perl",
@@ -251,10 +253,12 @@
15
]
],
- "name" : "014"
+ "name" : "014",
+ "id" : "014"
},
{
"id" : "015",
+ "name" : "015",
"data" : [
[
"Perl",
@@ -268,8 +272,7 @@
"Blog",
15
]
- ],
- "name" : "015"
+ ]
},
{
"id" : "016",
@@ -291,7 +294,6 @@
},
{
"id" : "017",
- "name" : "017",
"data" : [
[
"Perl",
@@ -305,9 +307,12 @@
"Blog",
12
]
- ]
+ ],
+ "name" : "017"
},
{
+ "id" : "018",
+ "name" : "018",
"data" : [
[
"Perl",
@@ -321,11 +326,11 @@
"Blog",
14
]
- ],
- "name" : "018",
- "id" : "018"
+ ]
},
{
+ "id" : "019",
+ "name" : "019",
"data" : [
[
"Perl",
@@ -339,12 +344,11 @@
"Blog",
13
]
- ],
- "name" : "019",
- "id" : "019"
+ ]
},
{
"id" : "020",
+ "name" : "020",
"data" : [
[
"Perl",
@@ -358,8 +362,7 @@
"Blog",
13
]
- ],
- "name" : "020"
+ ]
},
{
"id" : "021",
@@ -380,7 +383,6 @@
"name" : "021"
},
{
- "id" : "022",
"name" : "022",
"data" : [
[
@@ -395,11 +397,11 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "022"
},
{
"id" : "023",
- "name" : "023",
"data" : [
[
"Perl",
@@ -413,10 +415,11 @@
"Blog",
12
]
- ]
+ ],
+ "name" : "023"
},
{
- "name" : "024",
+ "id" : "024",
"data" : [
[
"Perl",
@@ -431,10 +434,11 @@
11
]
],
- "id" : "024"
+ "name" : "024"
},
{
"id" : "025",
+ "name" : "025",
"data" : [
[
"Perl",
@@ -448,10 +452,10 @@
"Blog",
12
]
- ],
- "name" : "025"
+ ]
},
{
+ "id" : "026",
"name" : "026",
"data" : [
[
@@ -466,10 +470,10 @@
"Blog",
10
]
- ],
- "id" : "026"
+ ]
},
{
+ "id" : "027",
"data" : [
[
"Perl",
@@ -484,11 +488,9 @@
9
]
],
- "name" : "027",
- "id" : "027"
+ "name" : "027"
},
{
- "id" : "028",
"data" : [
[
"Perl",
@@ -503,11 +505,11 @@
9
]
],
- "name" : "028"
+ "name" : "028",
+ "id" : "028"
},
{
"id" : "029",
- "name" : "029",
"data" : [
[
"Perl",
@@ -521,10 +523,10 @@
"Blog",
12
]
- ]
+ ],
+ "name" : "029"
},
{
- "id" : "030",
"name" : "030",
"data" : [
[
@@ -539,10 +541,10 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "030"
},
{
- "id" : "031",
"data" : [
[
"Perl",
@@ -557,9 +559,11 @@
9
]
],
- "name" : "031"
+ "name" : "031",
+ "id" : "031"
},
{
+ "id" : "032",
"name" : "032",
"data" : [
[
@@ -574,11 +578,11 @@
"Blog",
10
]
- ],
- "id" : "032"
+ ]
},
{
"id" : "033",
+ "name" : "033",
"data" : [
[
"Perl",
@@ -592,11 +596,9 @@
"Blog",
10
]
- ],
- "name" : "033"
+ ]
},
{
- "id" : "034",
"name" : "034",
"data" : [
[
@@ -611,10 +613,10 @@
"Blog",
11
]
- ]
+ ],
+ "id" : "034"
},
{
- "name" : "035",
"data" : [
[
"Perl",
@@ -629,9 +631,11 @@
9
]
],
+ "name" : "035",
"id" : "035"
},
{
+ "name" : "036",
"data" : [
[
"Perl",
@@ -646,7 +650,6 @@
11
]
],
- "name" : "036",
"id" : "036"
},
{
@@ -668,6 +671,7 @@
"id" : "037"
},
{
+ "name" : "038",
"data" : [
[
"Perl",
@@ -682,11 +686,10 @@
12
]
],
- "name" : "038",
"id" : "038"
},
{
- "name" : "039",
+ "id" : "039",
"data" : [
[
"Perl",
@@ -701,11 +704,9 @@
12
]
],
- "id" : "039"
+ "name" : "039"
},
{
- "id" : "040",
- "name" : "040",
"data" : [
[
"Perl",
@@ -719,10 +720,11 @@
"Blog",
10
]
- ]
+ ],
+ "name" : "040",
+ "id" : "040"
},
{
- "name" : "041",
"data" : [
[
"Perl",
@@ -737,11 +739,10 @@
9
]
],
+ "name" : "041",
"id" : "041"
},
{
- "id" : "042",
- "name" : "042",
"data" : [
[
"Perl",
@@ -755,9 +756,13 @@
"Blog",
11
]
- ]
+ ],
+ "name" : "042",
+ "id" : "042"
},
{
+ "id" : "043",
+ "name" : "043",
"data" : [
[
"Perl",
@@ -771,12 +776,11 @@
"Blog",
11
]
- ],
- "name" : "043",
- "id" : "043"
+ ]
},
{
"id" : "044",
+ "name" : "044",
"data" : [
[
"Perl",
@@ -790,10 +794,10 @@
"Blog",
11
]
- ],
- "name" : "044"
+ ]
},
{
+ "id" : "045",
"name" : "045",
"data" : [
[
@@ -808,8 +812,7 @@
"Blog",
11
]
- ],
- "id" : "045"
+ ]
},
{
"id" : "046",
@@ -830,6 +833,7 @@
"name" : "046"
},
{
+ "id" : "047",
"name" : "047",
"data" : [
[
@@ -844,11 +848,11 @@
"Blog",
10
]
- ],
- "id" : "047"
+ ]
},
{
"id" : "048",
+ "name" : "048",
"data" : [
[
"Perl",
@@ -862,11 +866,10 @@
"Blog",
12
]
- ],
- "name" : "048"
+ ]
},
{
- "id" : "049",
+ "name" : "049",
"data" : [
[
"Perl",
@@ -881,11 +884,10 @@
12
]
],
- "name" : "049"
+ "id" : "049"
},
{
"id" : "050",
- "name" : "050",
"data" : [
[
"Perl",
@@ -899,10 +901,10 @@
"Blog",
12
]
- ]
+ ],
+ "name" : "050"
},
{