From db68af58cd4f07ef269c867753caf75841d5bb73 Mon Sep 17 00:00:00 2001 From: 冯昶 Date: Mon, 17 Jun 2019 18:36:32 +0800 Subject: challenge 013 #1 --- challenge-009/feng-chang/README | 1 + challenge-009/feng-chang/perl5/ch-1.pl | 16 ++++++++++++++++ challenge-009/feng-chang/perl6/ch-1-one-liner.p6 | 4 ++++ challenge-009/feng-chang/perl6/ch-1.p6 | 8 ++++++++ challenge-013/feng-chang/README | 1 + challenge-013/feng-chang/perl6/ch-1.p6 | 13 +++++++++++++ 6 files changed, 43 insertions(+) create mode 100644 challenge-009/feng-chang/README create mode 100755 challenge-009/feng-chang/perl5/ch-1.pl create mode 100755 challenge-009/feng-chang/perl6/ch-1-one-liner.p6 create mode 100755 challenge-009/feng-chang/perl6/ch-1.p6 create mode 100644 challenge-013/feng-chang/README create mode 100755 challenge-013/feng-chang/perl6/ch-1.p6 diff --git a/challenge-009/feng-chang/README b/challenge-009/feng-chang/README new file mode 100644 index 0000000000..74e56de3ed --- /dev/null +++ b/challenge-009/feng-chang/README @@ -0,0 +1 @@ +Solutions by Feng Chang. diff --git a/challenge-009/feng-chang/perl5/ch-1.pl b/challenge-009/feng-chang/perl5/ch-1.pl new file mode 100755 index 0000000000..a883e28946 --- /dev/null +++ b/challenge-009/feng-chang/perl5/ch-1.pl @@ -0,0 +1,16 @@ +#!/bin/env perl + +use Modern::Perl; +use List::Uniq ':all'; + +my $n = 101; +my $n2; + +while (1) { + $n2 = $n * $n; + last if @{ uniq sort split(//, $n2) } >= 5; + + ++$n; +} + +say "$n2 = $n * $n"; diff --git a/challenge-009/feng-chang/perl6/ch-1-one-liner.p6 b/challenge-009/feng-chang/perl6/ch-1-one-liner.p6 new file mode 100755 index 0000000000..7699bd89c8 --- /dev/null +++ b/challenge-009/feng-chang/perl6/ch-1-one-liner.p6 @@ -0,0 +1,4 @@ +#!/bin/env perl6 + +my $n = (101 ... *).map({ $_ if ($_ * $_).comb.unique.elems >= 5 }).[0]; +say $n * $n, " = $n * $n"; diff --git a/challenge-009/feng-chang/perl6/ch-1.p6 b/challenge-009/feng-chang/perl6/ch-1.p6 new file mode 100755 index 0000000000..1039d77b3d --- /dev/null +++ b/challenge-009/feng-chang/perl6/ch-1.p6 @@ -0,0 +1,8 @@ +#!/bin/env perl6 + +for (101 ... *) -> $n { + my int $n2 = $n * $n; + last if $n2.comb.unique.elems >= 5; + + LAST { say "$n2 = $n * $n" } +} diff --git a/challenge-013/feng-chang/README b/challenge-013/feng-chang/README new file mode 100644 index 0000000000..74e56de3ed --- /dev/null +++ b/challenge-013/feng-chang/README @@ -0,0 +1 @@ +Solutions by Feng Chang. diff --git a/challenge-013/feng-chang/perl6/ch-1.p6 b/challenge-013/feng-chang/perl6/ch-1.p6 new file mode 100755 index 0000000000..51e3da63df --- /dev/null +++ b/challenge-013/feng-chang/perl6/ch-1.p6 @@ -0,0 +1,13 @@ +#!/bin/env perl6 + +my $format = sub ($self) { sprintf '%04d/%02d/%02d', .year, .month, .day, given $self }; + +sub last-day-to-last-friday(Int $year, Int $month, Int $day) { + my Date $d = Date.new(sprintf("%04d-%02d-%02d", $year, $month, $day)); + $d -= ($d.day-of-week - 5) mod 7; +} + +sub MAIN(Int $year) { + my @last-days = 31, Date.new(year => $year).is-leap-year ?? 29 !! 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31; + (1 .. 12).map({ last-day-to-last-friday($year, $_, @last-days[$_ - 1]) })».clone(formatter => $format)».say; +} -- cgit From b63817c7cd3f7262a3fe46a6bda302ca6a5e37d8 Mon Sep 17 00:00:00 2001 From: 冯昶 Date: Mon, 17 Jun 2019 18:54:42 +0800 Subject: challenge 013 #2 --- challenge-013/feng-chang/.gitignore | 1 + challenge-013/feng-chang/perl6/ch-1.p6 | 2 +- challenge-013/feng-chang/perl6/ch-2.p6 | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 challenge-013/feng-chang/.gitignore create mode 100755 challenge-013/feng-chang/perl6/ch-2.p6 diff --git a/challenge-013/feng-chang/.gitignore b/challenge-013/feng-chang/.gitignore new file mode 100644 index 0000000000..1377554ebe --- /dev/null +++ b/challenge-013/feng-chang/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/challenge-013/feng-chang/perl6/ch-1.p6 b/challenge-013/feng-chang/perl6/ch-1.p6 index 51e3da63df..17436e10c7 100755 --- a/challenge-013/feng-chang/perl6/ch-1.p6 +++ b/challenge-013/feng-chang/perl6/ch-1.p6 @@ -3,7 +3,7 @@ my $format = sub ($self) { sprintf '%04d/%02d/%02d', .year, .month, .day, given $self }; sub last-day-to-last-friday(Int $year, Int $month, Int $day) { - my Date $d = Date.new(sprintf("%04d-%02d-%02d", $year, $month, $day)); + my Date $d = Date.new(sprintf "%04d-%02d-%02d", $year, $month, $day); $d -= ($d.day-of-week - 5) mod 7; } diff --git a/challenge-013/feng-chang/perl6/ch-2.p6 b/challenge-013/feng-chang/perl6/ch-2.p6 new file mode 100755 index 0000000000..262dfce177 --- /dev/null +++ b/challenge-013/feng-chang/perl6/ch-2.p6 @@ -0,0 +1,12 @@ +#!/bin/env perl6 + +multi F(0) { 1 } +multi F(Int $n where * > 0) { $n - M(F($n - 1)) } + +multi M(0) { 0 } +multi M(Int $n where * > 0) { $n - F(M($n - 1)) } + +sub MAIN(Int $n where * >= 0) { + (^$n)».&F.say; + (^$n)».&M.say; +} -- cgit From 435e1df337412ba819adb78930d12e7298f17277 Mon Sep 17 00:00:00 2001 From: 冯昶 Date: Mon, 15 Jun 2020 18:37:38 +0800 Subject: raku solution --- challenge-064/feng-chang/raku/ch-1.raku | 34 +++++++++++++++++++++++++++++++++ challenge-064/feng-chang/raku/ch-2.raku | 27 ++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100755 challenge-064/feng-chang/raku/ch-1.raku create mode 100755 challenge-064/feng-chang/raku/ch-2.raku diff --git a/challenge-064/feng-chang/raku/ch-1.raku b/challenge-064/feng-chang/raku/ch-1.raku new file mode 100755 index 0000000000..9f1add1f31 --- /dev/null +++ b/challenge-064/feng-chang/raku/ch-1.raku @@ -0,0 +1,34 @@ +#!/bin/env raku + +my Int $M = prompt 'm: '; +my Int $N = prompt 'n: '; + +my @a; +for $*IN.lines() -> $line { + @a.append($line.comb(/(\d+)/)); + last if @a.elems ≥ $M * $N; +} + +my Int @Mat[$M;$N]; +for ^$M -> Int $i { + for ^$N -> Int $j { + @Mat[$i;$j] = @a.shift.Int; + } +} + +my @Path[$M;$N]; +@Path[0;0] = [@Mat[0;0]]; + +for 1 .. $M + $N - 2 -> Int $s { + for (0, $s - $N + 1).max .. ($s, $M - 1).min -> Int $i { + my Int $j = $s - $i; + + ($i > 0 ?? [+] @Path[$i-1;$j] !! ∞) < ($j > 0 ?? [+] @Path[$i;$j-1] !! ∞) ?? + (@Path[$i;$j] = @Path[$i-1;$j].clone) !! + (@Path[$i;$j] = @Path[$i;$j-1].clone); + + @Path[$i;$j].append(@Mat[$i;$j]); + } +} + +say "{ [+] @Path[$M-1;$N-1] } ({ @Path[$M-1;$N-1].join(' -> ') })"; diff --git a/challenge-064/feng-chang/raku/ch-2.raku b/challenge-064/feng-chang/raku/ch-2.raku new file mode 100755 index 0000000000..efc38f477e --- /dev/null +++ b/challenge-064/feng-chang/raku/ch-2.raku @@ -0,0 +1,27 @@ +#!/bin/env raku + +wrapper('perlweeklychallenge', ); +wrapper('perlandraku', ); + +sub wrapper(Str:D $S, @W) { + my @w = @W.sort({ $^a.chars < $^b.chars }); + my @res; + + my Bool $found-match = False; + split-into($S, @w, @res); + say 'no match' unless $found-match; + + sub split-into(Str:D $S, @W, @R) { + if $S eq '' { + say @R; + $found-match = True; + return; + } + + for @W -> Str $word { + next unless $S.starts-with($word); + + split-into($S.subst(/^$word/), @W, @R.push($word)); + } + } +} -- cgit From f35df0a84832788ae2e786e83c0de3504b2f9b0f Mon Sep 17 00:00:00 2001 From: 冯昶 Date: Fri, 21 Aug 2020 16:12:53 +0800 Subject: #072 #1 --- challenge-072/feng-chang/raku/ch-1a.raku | 14 ++++++++++++++ challenge-072/feng-chang/raku/ch-1b.raku | 5 +++++ 2 files changed, 19 insertions(+) create mode 100755 challenge-072/feng-chang/raku/ch-1a.raku create mode 100755 challenge-072/feng-chang/raku/ch-1b.raku diff --git a/challenge-072/feng-chang/raku/ch-1a.raku b/challenge-072/feng-chang/raku/ch-1a.raku new file mode 100755 index 0000000000..5701a8172e --- /dev/null +++ b/challenge-072/feng-chang/raku/ch-1a.raku @@ -0,0 +1,14 @@ +#!/bin/env raku + +# it all comes down to how many factors of 5 you have in N! +sub MAIN(UInt $N) { + my UInt $cnt = 0; + my UInt $f5s = 5; + + while $f5s <= $N { + $cnt += $N div $f5s; + $f5s *= 5; + } + + say "{$N}! has $cnt trailing zeros"; +} diff --git a/challenge-072/feng-chang/raku/ch-1b.raku b/challenge-072/feng-chang/raku/ch-1b.raku new file mode 100755 index 0000000000..10e8277d34 --- /dev/null +++ b/challenge-072/feng-chang/raku/ch-1b.raku @@ -0,0 +1,5 @@ +#!/bin/env raku + +sub MAIN(UInt $N) { + say "{$N}! has { (([*] 1..$N) ~~ /(0*$)/).chars } trailing zeros"; +} -- cgit From c78c938183297e7e8f494dd4a59fe82494f42774 Mon Sep 17 00:00:00 2001 From: 冯昶 Date: Fri, 21 Aug 2020 19:41:58 +0800 Subject: #074 #1 raku solution --- challenge-074/feng-chang/raku/ch-1.raku | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 challenge-074/feng-chang/raku/ch-1.raku diff --git a/challenge-074/feng-chang/raku/ch-1.raku b/challenge-074/feng-chang/raku/ch-1.raku new file mode 100755 index 0000000000..63316f8ca0 --- /dev/null +++ b/challenge-074/feng-chang/raku/ch-1.raku @@ -0,0 +1,19 @@ +#!/bin/env raku + +sub me(Int:D @a) { + my %cnts; + @a.map:{ ++%cnts{ $_ } }; + + my Bool $got-one = False; + for %cnts.keys -> $k { + if %cnts{ $k } > @a.elems / 2 { + say $k; + $got-one = True; + last; + } + } + say -1 unless $got-one; +} + +me(my Int @ = 1, 2, 2, 3, 2, 4, 2); +me(my Int @ = 1, 3, 1, 2, 4, 5); -- cgit From 2ff7886e24f0ee207d3aa299d2a34cf63e8f8378 Mon Sep 17 00:00:00 2001 From: 冯昶 Date: Wed, 26 Aug 2020 18:35:06 +0800 Subject: #075 ch-1.raku --- challenge-075/feng-chang/raku/ch-1.raku | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 challenge-075/feng-chang/raku/ch-1.raku diff --git a/challenge-075/feng-chang/raku/ch-1.raku b/challenge-075/feng-chang/raku/ch-1.raku new file mode 100755 index 0000000000..2cfd88dfb6 --- /dev/null +++ b/challenge-075/feng-chang/raku/ch-1.raku @@ -0,0 +1,19 @@ +#!/bin/env raku + +sub coins-sum(Int:D @C, Int:D $S, Int:D @solution) { + { say @solution; return; } if $S == 0; + return if $S < @C[0]; + + my Int @coins = @C; + while @coins.elems > 0 { + my Int @Sol = @solution; + @Sol.push(@coins[0]); + coins-sum(@coins, $S - @coins[0], @Sol); + + @coins.shift; + } +} + +my Int @coins = 1, 2, 4; +my Int @solution; +coins-sum(@coins, 6, @solution); -- cgit From 3e8f3db647754ea702c9efe149026c4a8d88b460 Mon Sep 17 00:00:00 2001 From: boblied Date: Wed, 26 Aug 2020 17:21:43 -0500 Subject: Update README --- challenge-075/bob-lied/README | 54 ++----------------------------------------- 1 file changed, 2 insertions(+), 52 deletions(-) diff --git a/challenge-075/bob-lied/README b/challenge-075/bob-lied/README index e3712fbb10..b4b27d55df 100644 --- a/challenge-075/bob-lied/README +++ b/challenge-075/bob-lied/README @@ -1,53 +1,3 @@ -Solutions to weekly challenge 74 by Bob Lied. +Solutions to weekly challenge 75 by Bob Lied. -https://perlweeklychallenge.org/blog/perl-weekly-challenge-074/ - -* TASK #1 > Majority Element - -** Initial thoughts - -This is going to be an exercise in hashes and grep. - -** Post Solution Thoughts - -Use a hash to count to count elements, then use grep with a code block to select the match. - -** Problem Statement - -You are given an array of integers of size $N. -Write a script to find the majority element. If none found then print -1. -Majority element in the list is the one that appears more than floor(size_of_list/2). - - - -* TASK #2 > FNR Character - -** Initial Thoughts - -The specification is a little odd and doesn't match the example. But, OK, whatever. -Similar to the first task, another hash to count occurrences and grep to find the answers. - -** Post Solution Thoughts - -Going through the string could be either done with substr one character at a time, -or splitting the string into an array of characters. Finding the first char could be -a search through the character positions, or a sort and picking off the first element. -Sort is the easy answer, but I'm always wary of scaling. Like in many of these -problems, it's not an issue for "reasonable" strings, but could become a performance -question if the strings were a thousand or a million times bigger. - - -** Problem Statement - -You are given a string $S. - -Write a script to print the series of first non-repeating character -(left -> right) for the given string. Print # if none found. -Example 1 -Input: $S = ‘ababc’ -Output: ‘abb#c’ -Pass 1: “a”, the FNR character is ‘a’ -Pass 2: “ab”, the FNR character is ‘b’ -Pass 3: “aba”, the FNR character is ‘b’ -Pass 4: “abab”, no FNR found, hence ‘#’ -Pass 5: “ababc” the FNR character is ‘c’ +https://perlweeklychallenge.org/blog/perl-weekly-challenge-075/ -- cgit From 4a2d3428b9c5d6fbbfabafe0d9303b45bdb59295 Mon Sep 17 00:00:00 2001 From: 冯昶 Date: Thu, 27 Aug 2020 13:50:15 +0800 Subject: #075 ch-2.raku --- challenge-075/feng-chang/raku/ch-2.raku | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 challenge-075/feng-chang/raku/ch-2.raku diff --git a/challenge-075/feng-chang/raku/ch-2.raku b/challenge-075/feng-chang/raku/ch-2.raku new file mode 100755 index 0000000000..b348d5350a --- /dev/null +++ b/challenge-075/feng-chang/raku/ch-2.raku @@ -0,0 +1,13 @@ +#!/bin/env raku + +sub largest-rectangle-histogram(Int:D @A) { + print "[{@A}] -> "; + 0..@A.elems-1 X 0..@A.elems-1 ==> + grep { .[0] ≤ .[1] } ==> + map { min(|@A[.[0] .. .[1]]) * (.[1] - .[0] + 1) } ==> + max() ==> + say(); +} + +largest-rectangle-histogram(my Int @ = 2, 1, 4, 5, 3, 7); +largest-rectangle-histogram(my Int @ = 3, 2, 3, 5, 7, 5); -- cgit From 8e13e536204d931c47a27749f3347857c95d6cfc Mon Sep 17 00:00:00 2001 From: Bob Lied Date: Sat, 29 Aug 2020 17:56:18 -0500 Subject: CoinSum first pass --- challenge-075/bob-lied/perl/ch-1.pl | 49 +++++++++++++++++++++++++ challenge-075/bob-lied/perl/lib/CoinSum.pm | 59 ++++++++++++++++++++++++++++++ challenge-075/bob-lied/perl/t/CoinSum.t | 24 ++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 challenge-075/bob-lied/perl/ch-1.pl create mode 100644 challenge-075/bob-lied/perl/lib/CoinSum.pm create mode 100644 challenge-075/bob-lied/perl/t/CoinSum.t diff --git a/challenge-075/bob-lied/perl/ch-1.pl b/challenge-075/bob-lied/perl/ch-1.pl new file mode 100644 index 0000000000..42b51a19f3 --- /dev/null +++ b/challenge-075/bob-lied/perl/ch-1.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl +# vim:set ts=4 sw=4 sts=4 et ai wm=0 nu syntax=perl: +# +# Copyright (c) 2020 Bob Lied +# The copyright notice above does not evidence any actual +# or intended publication of such source code. + +#=============================================================================== +# ch-1.pl +# +# Description: +# Perl Weekly Challenge 075 Task #1 > Coins Sum +#=============================================================================== +# You are given a set of coins @C, assuming you have infinite amount of each coin in the set. +# Write a script to find how many ways you make sum $S using the coins from the set @C. +# +# Example: +# Input: +# @C = (1, 2, 4) +# $S = 6 +# +# Output: 6 +# There are 6 possible ways to make sum 6. +# a) (1, 1, 1, 1, 1, 1) +# b) (1, 1, 1, 1, 2) +# c) (1, 1, 2, 2) +# d) (1, 1, 4) +# e) (2, 2, 2) +# f) (2, 4) + +use strict; +use warnings; +use feature qw(say); + +use lib "lib"; +use CoinSum qw(coinSum); + +sub Usage { "Usage: $0 SUM coin1 [coin2..coinN]" }; + +my $S = shift; +my @C = @ARGV; + +die Usage() unless $S; +die Usage() unless @C; + +# Sort denominations so largest is first. +@C = sort { $a < $b } @C; + +coinSum($S, @C); diff --git a/challenge-075/bob-lied/perl/lib/CoinSum.pm b/challenge-075/bob-lied/perl/lib/CoinSum.pm new file mode 100644 index 0000000000..a5a7f818a5 --- /dev/null +++ b/challenge-075/bob-lied/perl/lib/CoinSum.pm @@ -0,0 +1,59 @@ +# vim:set ts=4 sw=4 sts=4 et ai wm=0 nu syntax=perl: +# +# Copyright (c) 2020 Bob Lied +# The copyright notice above does not evidence any actual +# or intended publication of such source code. + +#=============================================================================== +# CoinSum.pm +# +# Description: +# +#=============================================================================== + +package CoinSum; + +use strict; +use warnings; +use 5.010; +use Carp; + +require Exporter; +our @ISA = qw(Exporter); +our @EXPORT = qw(coinSum); +our @EXPORT_OK = qw(); + + +my @Combo; + +sub _coinSum +{ + my ($target, $denomList, $currentSum, $currentDenom, $comboNum = @_; + + return 0 if ( $currentSum > $target ); + + return 1 if ( $currentSum == $target ); + + my $count = 0; + for my $denom ( @$denomList ) + { + push @{$Combo[$comboNum]] $denom; + if ( $denom >= $currentDenom ) + { + $comboNum += _coinSum($target, $denomList, $currentSum + $currentDenom, $denom, $comboNum); + } + } + return $0; +} + +sub coinSum +{ + my ($sum, @coins) = @_; + + _coinSum($sum, \@coins, 0, $coins[0], 0); + + return 0; +} + +1; + diff --git a/challenge-075/bob-lied/perl/t/CoinSum.t b/challenge-075/bob-lied/perl/t/CoinSum.t new file mode 100644 index 0000000000..2157772195 --- /dev/null +++ b/challenge-075/bob-lied/perl/t/CoinSum.t @@ -0,0 +1,24 @@ +#=============================================================================== +# +# FILE: CoinSum.t +# +# DESCRIPTION: +# +# FILES: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Bob Lied (RL), bob.lied@nokia.com +# ORGANIZATION: PNM +# VERSION: 1.0 +# CREATED: 2020-08-24 10:10:03 AM +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use 5.010; + +use Test2::V0; + +done_testing(); + -- cgit From 6924c8ff668659c426e6c1355e71bd01b31b4aea Mon Sep 17 00:00:00 2001 From: boblied Date: Sat, 29 Aug 2020 18:13:52 -0500 Subject: Update README message --- challenge-075/bob-lied/README | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/challenge-075/bob-lied/README b/challenge-075/bob-lied/README index b4b27d55df..e0e8e4f76c 100644 --- a/challenge-075/bob-lied/README +++ b/challenge-075/bob-lied/README @@ -1,3 +1,2 @@ -Solutions to weekly challenge 75 by Bob Lied. - +Solutions to Perl Weekly Challenge 075 by Bob Lied https://perlweeklychallenge.org/blog/perl-weekly-challenge-075/ -- cgit From ba07512c4e2aa71c93c87b86bfad1ffb34a6e593 Mon Sep 17 00:00:00 2001 From: Dave Jacoby Date: Fri, 4 Sep 2020 23:58:08 -0400 Subject: This week --- challenge-076/dave-jacoby/perl/ch-1.pl | 56 ++++++++++++++ challenge-076/dave-jacoby/perl/ch-2.pl | 109 +++++++++++++++++++++++++++ challenge-076/dave-jacoby/perl/word_grid.txt | 19 +++++ 3 files changed, 184 insertions(+) create mode 100644 challenge-076/dave-jacoby/perl/ch-1.pl create mode 100644 challenge-076/dave-jacoby/perl/ch-2.pl create mode 100644 challenge-076/dave-jacoby/perl/word_grid.txt diff --git a/challenge-076/dave-jacoby/perl/ch-1.pl b/challenge-076/dave-jacoby/perl/ch-1.pl new file mode 100644 index 0000000000..9b2e4cef89 --- /dev/null +++ b/challenge-076/dave-jacoby/perl/ch-1.pl @@ -0,0 +1,56 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use feature qw{ say signatures state }; +no warnings qw{ experimental }; + +use List::Util qw{ sum sum0 max }; +use Getopt::Long; + +my $n = 9; +GetOptions( 'n=i' => \$n, ); + +use JSON; +my $json = JSON->new->space_after->canonical; + +my @primes = reverse grep { is_prime($_) } 2 .. $n; +my @output = prime_sum( $n, \@primes ); + +map { say $json->encode($_) } @output; +say ''; +say $json->encode( $output[0] ); + +sub prime_sum ( $n, $primes, $list = [], $depth = 1 ) { + my @output; + my %join; + + my @list = ( [] ); + +OUTER: while (@list) { + my $e = shift @list; + for my $p ( $primes->@* ) { + my $new->@* = reverse sort $e->@*, $p; + my $sum = sum $new->@*; + my $join = join ' ', $new->@*; + next if $join{$join}++; + push @list, $new if $sum < $n; + push @output, $new if $sum == $n; + last OUTER if $sum == $n; + } + } + return @output; +} + +sub is_prime ( $n ) { + my @factors = factor($n); + return scalar @factors == 1 ? 1 : 0; +} + +sub factor ( $n ) { + my @factors; + for my $i ( 1 .. $n - 1 ) { + push @factors, $i if $n % $i == 0; + } + return @factors; +} diff --git a/challenge-076/dave-jacoby/perl/ch-2.pl b/challenge-076/dave-jacoby/perl/ch-2.pl new file mode 100644 index 0000000000..7a36c770da --- /dev/null +++ b/challenge-076/dave-jacoby/perl/ch-2.pl @@ -0,0 +1,109 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use feature qw{ say signatures state }; +no warnings qw{ experimental }; + +use Getopt::Long; + +my $word_grid = 'word_grid.txt'; +my $dictionary = '/usr/share/dict/words'; +my $output = {}; + +GetOptions( + 'dictionary=s' => \$dictionary, + 'wordsearch=s' => \$word_grid, +); + +my $words = get_words($dictionary); +my $word_search = get_word_search($word_grid); + +do_word_search( $word_search, $words ); + +my $wc = scalar keys $output->%*; +say join "\n\t", "There were $wc unique words in this word search", + sort keys $output->%*; + +sub do_word_search ( $graph, $dictionary ) { + my $xp = scalar $graph->@* - 1; + my $yp = scalar $graph->[0]->@* - 1; + + for my $x ( 0 .. $xp ) { + for my $y ( 0 .. $yp ) { + my $l = $graph->[$x][$y]; + find_word_vertical( $x + 1, $y, [$l], $graph, $dictionary ); + find_word_horizontal( $x, $y + 1, [$l], $graph, $dictionary ); + find_word_diagonal( $x + 1, $y + 1, [$l], $graph, $dictionary ); + find_word_diagonal2( $x + 1, $y - 1, [$l], $graph, $dictionary ); + } + } +} + +sub find_word_vertical ( $x, $y, $strp, $graph, $dictionary ) { + my $l = $graph->[$x][$y]; + return unless defined $l; + push $strp->@*, $l; + my $w1 = join '', $strp->@*; + my $w2 = join '', reverse $strp->@*; + $output->{$w1}++ if $dictionary->{$w1}; + $output->{$w2}++ if $dictionary->{$w2}; + find_word_vertical( $x + 1, $y, $strp, $graph, $dictionary ); +} + +sub find_word_horizontal ( $x, $y, $strp, $graph, $dictionary ) { + my $l = $graph->[$x][$y]; + return unless defined $l; + push $strp->@*, $l; + my $w1 = join '', $strp->@*; + my $w2 = join '', reverse $strp->@*; + $output->{$w1}++ if $dictionary->{$w1}; + $output->{$w2}++ if $dictionary->{$w2}; + find_word_horizontal( $x, $y + 1, $strp, $graph, $dictionary ); +} + +sub find_word_diagonal ( $x, $y, $strp, $graph, $dictionary ) { + my $l = $graph->[$x][$y]; + return unless defined $l; + push $strp->@*, $l; + my $w1 = join '', $strp->@*; + my $w2 = join '', reverse $strp->@*; + $output->{$w1}++ if $dictionary->{$w1}; + $output->{$w2}++ if $dictionary->{$w2}; + find_word_diagonal( $x + 1, $y + 1, $strp, $graph, $dictionary ); +} + +sub find_word_diagonal2 ( $x, $y, $strp, $graph, $dictionary ) { + my $l = $graph->[$x][$y]; + return unless defined $l; + push $strp->@*, $l; + my $w1 = join '', $strp->@*; + my $w2 = join '', reverse $strp->@*; + $output->{$w1}++ if $dictionary->{$w1}; + $output->{$w2}++ if $dictionary->{$w2}; + find_word_diagonal( $x + 1, $y - 1, $strp, $graph, $dictionary ); +} + +sub get_word_search( $file ) { + my $ws = []; + if ( -f $file && open my $fh, '<', $file ) { + while ( my $line = <$fh> ) { + my @line = map { uc $_ } split /\W/, $line; + push $ws->@*, [@line]; + } + } + return wantarray ? $ws->@* : $ws; +} + +sub get_words ($file) { + my %words; + if ( -f $file && open my $fh, '<', $file ) { + while ( my $word = <$fh> ) { + chomp $word; + $word = uc $word; + next if $word =~ /\W/; + $words{$word} = 1; + } + } + return wantarray ? %words : \%words; +} diff --git a/challenge-076/dave-jacoby/perl/word_grid.txt b/challenge-076/dave-jacoby/perl/word_grid.txt new file mode 100644 index 0000000000..c5766eae93 --- /dev/null +++ b/challenge-076/dave-jacoby/perl/word_grid.txt @@ -0,0 +1,19 @@ +B I D E M I A T S U C C O R S T +L D E G G I W Q H O D E E H D P +U S E I R U B U T E A S L A G U +N G N I Z I L A I C O S C N U D +T G M I D S T S A R A R E I F G +S R E N M D C H A S I V E E L I +S C S H A E U E B R O A D M T E +H W O V L P E D D L A I U L S S +R Y O N L A S F C S T A O G O T +I G U S S R R U G O V A R Y O C +N R G P A T N A N G I L A M O O +E I H A C E I V I R U S E S E D +S E T S U D T T G A R L I C N H +H V R M X L W I U M S N S O T B +A E A O F I L C H T O D C A E U +Z S C D F E C A A I I R L N R F +A R I I A N Y U T O O O U T P F +R S E C I S N A B O S C N E R A +D R S M P C U U N E L T E S I L \ No newline at end of file -- cgit From 63afef8b9bfa507fca0fb5a9610a19043ffa14b9 Mon Sep 17 00:00:00 2001 From: Simon Proctor Date: Mon, 7 Sep 2020 09:35:24 +0100 Subject: Challange one --- challenge-077/simon-proctor/raku/ch-1.raku | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 challenge-077/simon-proctor/raku/ch-1.raku diff --git a/challenge-077/simon-proctor/raku/ch-1.raku b/challenge-077/simon-proctor/raku/ch-1.raku new file mode 100644 index 0000000000..7d4d1fd09a --- /dev/null +++ b/challenge-077/simon-proctor/raku/ch-1.raku @@ -0,0 +1,15 @@ +#!/usr/bin/env raku + +use v6; + +#| Find the possible combinations of Fibonacci Numbers that add up to N +sub MAIN ( + UInt $N #= Target number +) { + my @combos = (1,1,*+*...^* > $N).unique.combinations.grep( -> @c { $N == [+] @c } ); + if @combos { + (($_.join( " + " ))~" = $N").say for @combos; + } else { + say 0; + } +} -- cgit From fa2e939347ed4b34605aad080b0ffa517218162e Mon Sep 17 00:00:00 2001 From: Simon Proctor Date: Mon, 7 Sep 2020 10:00:40 +0100 Subject: O and X's --- challenge-077/simon-proctor/raku/ch-2.raku | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 challenge-077/simon-proctor/raku/ch-2.raku diff --git a/challenge-077/simon-proctor/raku/ch-2.raku b/challenge-077/simon-proctor/raku/ch-2.raku new file mode 100644 index 0000000000..60c94c7469 --- /dev/null +++ b/challenge-077/simon-proctor/raku/ch-2.raku @@ -0,0 +1,30 @@ +#!/usr/bin/env raku + +use v6; + +my %*SUB-MAIN-OPTS = :named-anywhere; + +#| Given a width and a list of O and X's +#| Makes a grid of the given width and counts the number of X's not touching any others +sub MAIN( + UInt $width, #= Width of the grid + :v(:$verbose) = False, #= Prints the Grid + *@cells where { "O"|"X" ~~ $_.all && $_.elems %% $width && $_.elems >= $width } +) { + my @grid = @cells.rotor($width); + @grid.map( *.join(" ")).join("\n").say if $verbose; + + my $count = 0; + for (0..^$width X, 0..^@grid.elems) -> @vec { + $count++ if @grid[@vec[1]][@vec[0]] ~~ "X" ~~ none(surrounding-cells( @vec, @grid )); + } + say $count; +} + +sub surrounds( @vec ) { + (-1..1 X, -1..1).grep( { ! ( $_[0] == $_[1] == 0 ) } ).map( { [ $_[0]+@vec[0], $_[1]+@vec[1] ] } ).grep( { $_[0]&$_[1] >= 0 } ); +} + +sub surrounding-cells( @vec, @grid ) { + surrounds(@vec).map( -> ($x,$y) { @grid[$y][$x] } ).grep( { defined $_ } ); +} -- cgit From 088221170be5d4e05e4b8cc3966443e9e15d6393 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 7 Sep 2020 10:21:05 +0100 Subject: - Added solutions by Scimon Proctor. --- stats/pwc-challenge-076.json | 612 ++++++ stats/pwc-current.json | 625 +----- stats/pwc-language-breakdown-summary.json | 72 +- stats/pwc-language-breakdown.json | 3025 +++++++++++++++-------------- stats/pwc-leaders.json | 752 +++---- stats/pwc-summary-1-30.json | 110 +- stats/pwc-summary-121-150.json | 28 +- stats/pwc-summary-151-180.json | 106 +- stats/pwc-summary-181-210.json | 76 +- stats/pwc-summary-31-60.json | 108 +- stats/pwc-summary-61-90.json | 102 +- stats/pwc-summary-91-120.json | 52 +- stats/pwc-summary.json | 34 +- 13 files changed, 2894 insertions(+), 2808 deletions(-) create mode 100644 stats/pwc-challenge-076.json diff --git a/stats/pwc-challenge-076.json b/stats/pwc-challenge-076.json new file mode 100644 index 0000000000..1f554f9b67 --- /dev/null +++ b/stats/pwc-challenge-076.json @@ -0,0 +1,612 @@ +{ + "series" : [ + { + "colorByPoint" : 1, + "name" : "Perl Weekly Challenge - 076", + "data" : [ + { + "y" : 3, + "drilldown" : "Adam Russell", + "name" : "Adam Russell" + }, + { + "name" : "Alexander Pankoff", + "drilldown" : "Alexander Pankoff", + "y" : 2 + }, + { + "y" : 2, + "drilldown" : "Andinus", + "name" : "Andinus" + }, + { + "drilldown" : "Arne Sommer", + "y" : 3, + "name" : "Arne Sommer" + }, + { + "name" : "Athanasius", + "drilldown" : "Athanasius", + "y" : 4 + }, + { + "name" : "Cheok-Yin Fung", + "y" : 3, + "drilldown" : "Cheok-Yin Fung" + }, + { + "y" : 5, + "drilldown" : "Colin Crain", + "name" : "Colin Crain" + }, + { + "name" : "Duncan C. White", + "y" : 2, + "drilldown" : "Duncan C. White" + }, + { + "drilldown" : "E. Choroba", + "y" : 2, + "name" : "E. Choroba" + }, + { + "drilldown" : "Jan Krnavek", + "y" : 1, + "name" : "Jan Krnavek" + }, + { + "drilldown" : "Jason Messer", + "y" : 2, + "name" : "Jason Messer" + }, + { + "drilldown" : "Javier Luque", + "y" : 5, + "name" : "Javier Luque" + }, + { + "drilldown" : "Jorg Sommrey", + "y" : 2, + "name" : "Jorg Sommrey" + }, + { + "name" : "Laurent Rosenfeld", + "drilldown" : "Laurent Rosenfeld", + "y" : 3 + }, + { + "name" : "Lubos Kolouch", + "y" : 2, + "drilldown" : "Lubos Kolouch" + }, + { + "y" : 4, + "drilldown" : "Luca Ferrari", + "name" : "Luca Ferrari" + }, + { + "name" : "Mark Anderson", + "drilldown" : "Mark Anderson", + "y" : 2 + }, + { + "name" : "Markus Holzer", + "drilldown" : "Markus Holzer", + "y" : 2 + }, + { + "y" : 6, + "drilldown" : "Mohammad S Anwar", + "name" : "Mohammad S Anwar" + }, + { + "y" : 4, + "drilldown" : "Myoungjin Jeon", + "name" : "Myoungjin Jeon" + }, + { + "y" : 2, + "drilldown" : "Neil Bowers", + "name" : "Neil Bowers" + }, + { + "y" : 2, + "drilldown" : "Niels van Dijke", + "name" : "Niels van Dijke" + }, + { + "drilldown" : "Nuno Vieira", + "y" : 2, + "name" : "Nuno Vieira" + }, + { + "name" : "Pete Houston", + "y" : 2, + "drilldown" : "Pete Houston" + }, + { + "y" : 5, + "drilldown" : "Roger Bell_West", + "name" : "Roger Bell_West" + }, + { + "name" : "Shahed Nooshmand", + "y" : 3, + "drilldown" : "Shahed Nooshmand" + }, + { + "name" : "Simon Green", + "y" : 3, + "drilldown" : "Simon Green" + }, + { + "drilldown" : "Simon Proctor", + "y" : 2, + "name" : "Simon Proctor" + }, + { + "name" : "Ulrich Rieke", + "y" : 1, + "drilldown" : "Ulrich Rieke" + }, + { + "name" : "Walt Mankowski", + "drilldown" : "Walt Mankowski", + "y" : 3 + }, + { + "drilldown" : "Wanderdoc", + "y" : 2, + "name" : "Wanderdoc" + }, + { + "y" : 1, + "drilldown" : "Yet Ebreo", + "name" : "Yet Ebreo" + } + ] + } + ], + "xAxis" : { + "type" : "category" + }, + "tooltip" : { + "followPointer" : 1, + "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "legend" : { + "enabled" : 0 + }, + "subtitle" : { + "text" : "[Champions: 32] Last updated at 2020-09-07 09:19:35 GMT" + }, + "title" : { + "text" : "Perl Weekly Challenge - 076" + }, + "drilldown" : { + "series" : [ + { + "name" : "Adam Russell", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Adam Russell" + }, + { + "name" : "Alexander Pankoff", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Alexander Pankoff" + }, + { + "id" : "Andinus", + "name" : "Andinus", + "data" : [ + [ + "Perl", + 1 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "id" : "Arne Sommer", + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Arne Sommer" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "name" : "Athanasius", + "id" : "Athanasius" + }, + { + "id" : "Cheok-Yin Fung", + "name" : "Cheok-Yin Fung", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Colin Crain", + "id" : "Colin Crain" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Duncan C. White", + "id" : "Duncan C. White" + }, + { + "id" : "E. Choroba", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "E. Choroba" + }, + { + "name" : "Jan Krnavek", + "data" : [ + [ + "Raku", + 1 + ] + ], + "id" : "Jan Krnavek" + }, + { + "name" : "Jason Messer", + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Jason Messer" + }, + { + "name" : "Javier Luque", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Javier Luque" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Jorg Sommrey", + "id" : "Jorg Sommrey" + }, + { + "id" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", + "data" : [ + [ + "Perl", + 1 + ], + [ + "Raku", + 1 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "id" : "Lubos Kolouch", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Lubos Kolouch" + }, + { + "name" : "Luca Ferrari", + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ], + "id" : "Luca Ferrari" + }, + { + "id" : "Mark Anderson", + "data" : [ + [ + "Raku", + 2 + ] + ], + "name" : "Mark Anderson" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "name" : "Markus Holzer", + "id" : "Markus Holzer" + }, + { + "id" : "Mohammad S Anwar", + "name" : "Mohammad S Anwar", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ] + }, + { + "name" : "Myoungjin Jeon", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "id" : "Myoungjin Jeon" + }, + { + "data" : [ + [ + "Perl", + 1 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Neil Bowers", + "id" : "Neil Bowers" + }, + { + "name" : "Niels van Dijke", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Niels van Dijke" + }, + { + "id" : "Nuno Vieira", + "name" : "Nuno Vieira", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "name" : "Pete Houston", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Pete Houston" + }, + { + "name" : "Roger Bell_West", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Roger Bell_West" + }, + { + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Shahed Nooshmand", + "id" : "Shahed Nooshmand" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Simon Green", + "id" : "Simon Green" + }, + { + "id" : "Simon Proctor", + "data" : [ + [ + "Raku", + 2 + ] + ], + "name" : "Simon Proctor" + }, + { + "id" : "Ulrich Rieke", + "name" : "Ulrich Rieke", + "data" : [ + [ + "Perl", + 1 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Walt Mankowski", + "id" : "Walt Mankowski" + }, + { + "id" : "Wanderdoc", + "name" : "Wanderdoc", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "name" : "Yet Ebreo", + "data" : [ + [ + "Perl", + 1 + ] + ], + "id" : "Yet Ebreo" + } + ] + }, + "chart" : { + "type" : "column" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + } +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index fd4eecf123..1c7d3f1c32 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,189 +1,32 @@ { - "subtitle" : { - "text" : "[Champions: 32] Last updated at 2020-09-07 00:16:46 GMT" - }, - "title" : { - "text" : "Perl Weekly Challenge - 076" + "legend" : { + "enabled" : 0 }, "tooltip" : { "headerFormat" : "{series.name}
", "pointFormat" : "{point.name}: {point.y:f}
", "followPointer" : 1 }, - "legend" : { - "enabled" : 0 + "title" : { + "text" : "Perl Weekly Challenge - 077" }, - "xAxis" : { - "type" : "category" + "drilldown" : { + "series" : [ + { + "name" : "Simon Proctor", + "id" : "Simon Proctor", + "data" : [ + [ + "Raku", + 2 + ] + ] + } + ] + }, + "chart" : { + "type" : "column" }, - "series" : [ - { - "data" : [ - { - "y" : 3, - "drilldown" : "Adam Russell", - "name" : "Adam Russell" - }, - { - "y" : 2, - "drilldown" : "Alexander Pankoff", - "name" : "Alexander Pankoff" - }, - { - "y" : 2, - "name" : "Andinus", - "drilldown" : "Andinus" - }, - { - "name" : "Arne Sommer", - "drilldown" : "Arne Sommer", - "y" : 3 - }, - { - "name" : "Athanasius", - "drilldown" : "Athanasius", - "y" : 4 - }, - { - "y" : 3, - "drilldown" : "Cheok-Yin Fung", - "name" : "Cheok-Yin Fung" - }, - { - "drilldown" : "Colin Crain", - "name" : "Colin Crain", - "y" : 5 - }, - { - "y" : 2, - "drilldown" : "Duncan C. White", - "name" : "Duncan C. White" - }, - { - "y" : 2, - "drilldown" : "E. Choroba", - "name" : "E. Choroba" - }, - { - "name" : "Jan Krnavek", - "drilldown" : "Jan Krnavek", - "y" : 1 - }, - { - "name" : "Jason Messer", - "drilldown" : "Jason Messer", - "y" : 2 - }, - { - "name" : "Javier Luque", - "drilldown" : "Javier Luque", - "y" : 5 - }, - { - "drilldown" : "Jorg Sommrey", - "name" : "Jorg Sommrey", - "y" : 2 - }, - { - "drilldown" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld", - "y" : 3 - }, - { - "y" : 2, - "name" : "Lubos Kolouch", - "drilldown" : "Lubos Kolouch" - }, - { - "name" : "Luca Ferrari", - "drilldown" : "Luca Ferrari", - "y" : 4 - }, - { - "name" : "Mark Anderson", - "drilldown" : "Mark Anderson", - "y" : 2 - }, - { - "drilldown" : "Markus Holzer", - "name" : "Markus Holzer", - "y" : 2 - }, - { - "drilldown" : "Mohammad S Anwar", - "name" : "Mohammad S Anwar", - "y" : 6 - }, - { - "y" : 4, - "name" : "Myoungjin Jeon", - "drilldown" : "Myoungjin Jeon" - }, - { - "y" : 2, - "drilldown" : "Neil Bowers", - "name" : "Neil Bowers" - }, - { - "y" : 2, - "drilldown" : "Niels van Dijke", - "name" : "Niels van Dijke" - }, - { - "drilldown" : "Nuno Vieira", - "name" : "Nuno Vieira", - "y" : 2 - }, - { - "name" : "Pete Houston", - "drilldown" : "Pete Houston", - "y" : 2 - }, - { - "name" : "Roger Bell_West", - "drilldown" : "Roger Bell_West", - "y" : 5 - }, - { - "drilldown" : "Shahed Nooshmand", - "name" : "Shahed Nooshmand", - "y" : 3 - }, - { - "drilldown" : "Simon Green", - "name" : "Simon Green", - "y" : 3 - }, - { - "drilldown" : "Simon Proctor", - "name" : "Simon Proctor", - "y" : 2 - }, - { - "y" : 1, - "drilldown" : "Ulrich Rieke", - "name" : "Ulrich Rieke" - }, - { - "y" : 3, - "name" : "Walt Mankowski", - "drilldown" : "Walt Mankowski" - }, - { - "drilldown" : "Wanderdoc", - "name" : "Wanderdoc", - "y" : 2 - }, - { - "name" : "Yet Ebreo", - "drilldown" : "Yet Ebreo", - "y" : 1 - } - ], - "name" : "Perl Weekly Challenge - 076", - "colorByPoint" : 1 - } - ], "plotOptions" : { "series" : { "dataLabels" : { @@ -193,420 +36,28 @@ "borderWidth" : 0 } }, + "xAxis" : { + "type" : "category" + }, "yAxis" : { "title" : { "text" : "Total Solutions" } }, - "drilldown" : { - "series" : [ - { - "id" : "Adam Russell", - "name" : "Adam Russell", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "name" : "Alexander Pankoff", - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Alexander Pankoff" - }, - { - "data" : [ - [ - "Perl", - 1 - ], - [ - "Blog", - 1 - ] - ], - "name" : "Andinus", - "id" : "Andinus" - }, - { - "name" : "Arne Sommer", - "data" : [ - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Arne Sommer" - }, - { - "id" : "Athanasius", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ], - "name" : "Athanasius" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "name" : "Cheok-Yin Fung", - "id" : "Cheok-Yin Fung" - }, - { - "name" : "Colin Crain", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Colin Crain" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Duncan C. White", - "id" : "Duncan C. White" - }, - { - "name" : "E. Choroba", - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "E. Choroba" - }, - { - "data" : [ - [ - "Raku", - 1 - ] - ], - "name" : "Jan Krnavek", - "id" : "Jan Krnavek" - }, - { - "name" : "Jason Messer", - "data" : [ - [ - "Raku", - 2 - ] - ], - "id" : "Jason Messer" - }, - { - "id" : "Javier Luque", - "name" : "Javier Luque", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "id" : "Jorg Sommrey", - "name" : "Jorg Sommrey", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "id" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld", - "data" : [ - [ - "Perl", - 1 - ], - [ - "Raku", - 1 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "name" : "Lubos Kolouch", - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Lubos Kolouch" - }, - { - "id" : "Luca Ferrari", - "data" : [ - [ - "Raku", - 2 - ], - [ - "Blog", - 2 - ] - ], - "name" : "Luca Ferrari" - }, - { - "id" : "Mark Anderson", - "data" : [ - [ - "Raku", - 2 - ] - ], - "name" : "Mark Anderson" - }, - { - "data" : [ - [ - "Raku", - 2 - ] - ], - "name" : "Markus Holzer", - "id" : "Markus Holzer" - }, - { - "id" : "Mohammad S Anwar", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 2 - ] - ], - "name" : "Mohammad S Anwar" - }, - { - "name" : "Myoungjin Jeon", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ], - "id" : "Myoungjin Jeon" - }, - { - "data" : [ - [ - "Perl", - 1 - ], - [ - "Blog", - 1 - ] - ], - "name" : "Neil Bowers", - "id" : "Neil Bowers" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Niels van Dijke", - "id" : "Niels van Dijke" - }, - { - "id" : "Nuno Vieira", - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Nuno Vieira" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Pete Houston", - "id" : "Pete Houston" - }, - { - "id" : "Roger Bell_West", - "name" : "Roger Bell_West", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "name" : "Shahed Nooshmand", - "data" : [ - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Shahed Nooshmand" - }, - { - "id" : "Simon Green", - "name" : "Simon Green", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "name" : "Simon Proctor", - "data" : [ - [ - "Raku", - 2 - ] - ], - "id" : "Simon Proctor" - }, - { - "data" : [ - [ - "Perl", - 1 - ] - ], - "name" : "Ulrich Rieke", - "id" : "Ulrich Rieke" - }, - { - "name" : "Walt Mankowski", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Walt Mankowski" - }, - { - "id" : "Wanderdoc", - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Wanderdoc" - }, - { - "data" : [ - [ - "Perl", - 1 - ] - ], - "name" : "Yet Ebreo", - "id" : "Yet Ebreo" - } - ] + "subtitle" : { + "text" : "[Champions: 1] Last updated at 2020-09-07 09:20:54 GMT" }, - "chart" : { - "type" : "column" - } + "series" : [ + { + "name" : "Perl Weekly Challenge - 077", + "data" : [ + { + "y" : 2, + "drilldown" : "Simon Proctor", + "name" : "Simon Proctor" + } + ], + "colorByPoint" : 1 + } + ] } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 96a4cfd1f1..442192ca25 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,22 +1,24 @@ { - "chart" : { - "type" : "column" + "xAxis" : { + "type" : "category", + "labels" : { + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + } + } + }, + "subtitle" : { + "text" : "Last updated at 2020-09-07 09:20:54 GMT" + }, + "yAxis" : { + "min" : 0, + "title" : { + "text" : null + } }, "series" : [ { - "dataLabels" : { - "y" : 10, - "rotation" : -90, - "format" : "{point.y:.0f}", - "color" : "#FFFFFF", - "align" : "right", - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - }, - "enabled" : "true" - }, - "name" : "Contributions", "data" : [ [ "Blog", @@ -28,36 +30,34 @@ ], [ "Raku", - 2079 + 2081 ] - ] + ], + "dataLabels" : { + "color" : "#FFFFFF", + "enabled" : "true", + "format" : "{point.y:.0f}", + "y" : 10, + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + }, + "rotation" : -90, + "align" : "right" + }, + "name" : "Contributions" } ], - "yAxis" : { - "min" : 0, - "title" : { - "text" : null - } - }, "tooltip" : { "pointFormat" : "{point.y:.0f}" }, - "subtitle" : { - "text" : "Last updated at 2020-09-07 00:16:46 GMT" + "legend" : { + "enabled" : "false" }, "title" : { "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" }, - "legend" : { - "enabled" : "false" - }, - "xAxis" : { - "labels" : { - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - } - }, - "type" : "category" + "chart" : { + "type" : "column" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 557d747ea3..338560eafc 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,1404 +1,12 @@ { - "legend" : { - "enabled" : "false" - }, - "xAxis" : { - "type" : "category" - }, - "title" : { - "text" : "Perl Weekly Challenge Language" - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2020-09-07 00:16:46 GMT" - }, - "tooltip" : { - "followPointer" : "true", - "pointFormat" : "Challenge {point.name}: {point.y:f}
", - "headerFormat" : "" - }, - "chart" : { - "type" : "column" - }, - "drilldown" : { - "series" : [ - { - "name" : "001", - "data" : [ - [ - "Perl", - 86 - ], - [ - "Raku", - 45 - ], - [ - "Blog", - 11 - ] - ], - "id" : "001" - }, - { - "id" : "002", - "data" : [ - [ - "Perl", - 65 - ], - [ - "Raku", - 34 - ], - [ - "Blog", - 10 - ] - ], - "name" : "002" - }, - { - "id" : "003", - "name" : "003", - "data" : [ - [ - "Perl", - 34 - ], - [ - "Raku", - 28 - ], - [ - "Blog", - 9 - ] - ] - }, - { - "id" : "004", - "name" : "004", - "data" : [ - [ - "Perl", - 50 - ], - [ - "Raku", - 31 - ], - [ - "Blog", - 10 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 36 - ], - [ - "Raku", - 24 - ], - [ - "Blog", - 12 - ] - ], - "name" : "005", - "id" : "005" - }, - { - "data" : [ - [ - "Perl", - 29 - ], - [ - "Raku", - 16 - ], - [ - "Blog", - 7 - ] - ], - "name" : "006", - "id" : "006" - }, - { - "id" : "007", - "data" : [ - [ - "Perl", - 28 - ], - [ - "Raku", - 21 -