aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Smith <js5@sanger.ac.uk>2022-12-30 12:40:51 +0000
committerGitHub <noreply@github.com>2022-12-30 12:40:51 +0000
commit45c6d0058689532f7a3742339a676d23a8193e50 (patch)
tree45b005a7da55416c73afdceed8780447db8205ce
parent4f4f3e92ae4f200f5ca209dd57348a99cf386aa3 (diff)
parentef1b6e72f5f8b7b06df4f7f955522b0eb7f554fd (diff)
downloadperlweeklychallenge-club-45c6d0058689532f7a3742339a676d23a8193e50.tar.gz
perlweeklychallenge-club-45c6d0058689532f7a3742339a676d23a8193e50.tar.bz2
perlweeklychallenge-club-45c6d0058689532f7a3742339a676d23a8193e50.zip
Merge branch 'manwar:master' into master
-rw-r--r--challenge-196/mohammad-anwar/perl/ch-2.pl52
-rw-r--r--challenge-196/wambash/raku/ch-1.raku20
-rw-r--r--challenge-196/wambash/raku/ch-2.raku29
-rw-r--r--challenge-197/bob-lied/README4
-rw-r--r--challenge-197/bob-lied/perl/ch-1.pl48
-rw-r--r--challenge-197/bob-lied/perl/ch-2.pl59
-rw-r--r--challenge-197/carlos-oliveira/perl/ch-1.pl14
-rw-r--r--challenge-197/carlos-oliveira/perl/ch-2.pl27
-rw-r--r--challenge-197/deadmarshal/d/ch1.d23
-rw-r--r--challenge-197/deadmarshal/d/ch2.d19
-rw-r--r--challenge-197/deadmarshal/lua/ch-1.lua16
-rw-r--r--challenge-197/deadmarshal/lua/ch-2.lua14
-rw-r--r--challenge-197/deadmarshal/modula-3/ch1/src/Ch1.m335
-rw-r--r--challenge-197/deadmarshal/modula-3/ch1/src/m3makefile3
-rw-r--r--challenge-197/deadmarshal/modula-3/ch2/src/Ch2.m337
-rw-r--r--challenge-197/deadmarshal/modula-3/ch2/src/m3makefile3
-rw-r--r--challenge-197/deadmarshal/nim/ch1.nim18
-rw-r--r--challenge-197/deadmarshal/nim/ch2.nim13
-rw-r--r--challenge-197/deadmarshal/oberon/Ch1.Mod48
-rw-r--r--challenge-197/deadmarshal/oberon/Ch2.Mod48
-rw-r--r--challenge-197/deadmarshal/pascal/ch1.pas33
-rw-r--r--challenge-197/deadmarshal/pascal/ch2.pas38
-rw-r--r--challenge-197/deadmarshal/perl/ch-1.pl15
-rw-r--r--challenge-197/deadmarshal/perl/ch-2.pl18
-rw-r--r--challenge-197/deadmarshal/raku/ch-1.raku12
-rw-r--r--challenge-197/deadmarshal/raku/ch-2.raku15
-rwxr-xr-xchallenge-197/eric-cheung/python/ch-1.py10
-rwxr-xr-xchallenge-197/eric-cheung/python/ch-2.py23
-rwxr-xr-xchallenge-197/feng-chang/raku/ch-1.raku8
-rwxr-xr-xchallenge-197/feng-chang/raku/ch-2.raku12
-rw-r--r--challenge-197/jeanluc2020/blog-1.txt1
-rw-r--r--challenge-197/jeanluc2020/blog-2.txt1
-rwxr-xr-xchallenge-197/jeanluc2020/perl/ch-1.pl39
-rwxr-xr-xchallenge-197/jeanluc2020/perl/ch-2.pl44
-rw-r--r--challenge-197/luca-ferrari/blog-1.txt1
-rw-r--r--challenge-197/luca-ferrari/blog-2.txt1
-rw-r--r--challenge-197/luca-ferrari/blog-3.txt1
-rw-r--r--challenge-197/luca-ferrari/blog-4.txt1
-rw-r--r--challenge-197/luca-ferrari/blog-5.txt1
-rw-r--r--challenge-197/luca-ferrari/blog-6.txt1
-rw-r--r--challenge-197/luca-ferrari/postgresql/ch-1.plperl23
-rw-r--r--challenge-197/luca-ferrari/postgresql/ch-1.sql32
-rw-r--r--challenge-197/luca-ferrari/postgresql/ch-2.plperl33
-rw-r--r--challenge-197/luca-ferrari/postgresql/ch-2.sql49
-rw-r--r--challenge-197/luca-ferrari/raku/ch-1.p69
-rw-r--r--challenge-197/luca-ferrari/raku/ch-2.p638
-rw-r--r--challenge-197/mark-anderson/raku/ch-1.raku13
-rw-r--r--challenge-197/mark-anderson/raku/ch-2.raku15
-rwxr-xr-xchallenge-197/perlboy1967/perl/ch-1.pl42
-rwxr-xr-xchallenge-197/perlboy1967/perl/ch-2.pl46
-rw-r--r--challenge-197/polettix/blog.txt1
-rw-r--r--challenge-197/polettix/blog1.txt1
-rw-r--r--challenge-197/polettix/perl/ch-1.pl23
-rw-r--r--challenge-197/polettix/perl/ch-2.pl14
-rw-r--r--challenge-197/polettix/raku/ch-1.raku20
-rw-r--r--challenge-197/polettix/raku/ch-2.raku15
-rw-r--r--challenge-197/robbie-hatley/blog.txt1
-rwxr-xr-xchallenge-197/robbie-hatley/perl/ch-1.pl55
-rwxr-xr-xchallenge-197/robbie-hatley/perl/ch-2.pl73
-rw-r--r--challenge-197/robert-dicicco/julia/ch-1.jl77
-rw-r--r--challenge-197/robert-dicicco/perl/ch-1.pl85
-rw-r--r--challenge-197/robert-dicicco/python/ch-1.py77
-rw-r--r--challenge-197/robert-dicicco/raku/ch-1.raku81
-rw-r--r--challenge-197/robert-dicicco/ruby/ch-1.rb79
-rwxr-xr-xchallenge-197/roger-bell-west/javascript/ch-1.js57
-rwxr-xr-xchallenge-197/roger-bell-west/javascript/ch-2.js91
-rw-r--r--challenge-197/roger-bell-west/kotlin/ch-1.kt28
-rw-r--r--challenge-197/roger-bell-west/kotlin/ch-2.kt90
-rwxr-xr-xchallenge-197/roger-bell-west/lua/ch-1.lua55
-rwxr-xr-xchallenge-197/roger-bell-west/lua/ch-2.lua103
-rwxr-xr-xchallenge-197/roger-bell-west/perl/ch-1.pl17
-rwxr-xr-xchallenge-197/roger-bell-west/perl/ch-2.pl54
-rw-r--r--challenge-197/roger-bell-west/postscript/ch-1.ps123
-rw-r--r--challenge-197/roger-bell-west/postscript/ch-2.ps170
-rwxr-xr-xchallenge-197/roger-bell-west/python/ch-1.py21
-rwxr-xr-xchallenge-197/roger-bell-west/python/ch-2.py61
-rwxr-xr-xchallenge-197/roger-bell-west/raku/ch-1.p615
-rwxr-xr-xchallenge-197/roger-bell-west/raku/ch-2.p652
-rwxr-xr-xchallenge-197/roger-bell-west/ruby/ch-1.rb23
-rwxr-xr-xchallenge-197/roger-bell-west/ruby/ch-2.rb76
-rwxr-xr-xchallenge-197/roger-bell-west/rust/ch-1.rs24
-rwxr-xr-xchallenge-197/roger-bell-west/rust/ch-2.rs80
-rw-r--r--challenge-197/steve-g-lynn/blog.txt1
-rwxr-xr-xchallenge-197/steve-g-lynn/perl/ch-1.sh3
-rwxr-xr-xchallenge-197/steve-g-lynn/perl/ch-2.pl44
-rwxr-xr-xchallenge-197/steve-g-lynn/raku/ch-1.sh3
-rwxr-xr-xchallenge-197/steve-g-lynn/raku/ch-2.p638
-rw-r--r--challenge-197/ulrich-rieke/cpp/ch-1.cpp32
-rw-r--r--challenge-197/ulrich-rieke/cpp/ch-2.cpp73
-rw-r--r--challenge-197/ulrich-rieke/haskell/ch-1.hs5
-rw-r--r--challenge-197/ulrich-rieke/haskell/ch-2.hs39
-rw-r--r--challenge-197/ulrich-rieke/perl/ch-1.pl20
-rw-r--r--challenge-197/ulrich-rieke/perl/ch-2.pl58
-rw-r--r--challenge-197/ulrich-rieke/raku/ch-1.raku9
-rw-r--r--challenge-197/ulrich-rieke/raku/ch-2.raku48
-rw-r--r--challenge-197/ulrich-rieke/rust/ch-1.rs24
-rw-r--r--challenge-197/ulrich-rieke/rust/ch-2.rs61
-rw-r--r--challenge-197/wlmb/blog.txt1
-rwxr-xr-xchallenge-197/wlmb/perl/ch-1.pl12
-rwxr-xr-xchallenge-197/wlmb/perl/ch-1a.pl13
-rwxr-xr-xchallenge-197/wlmb/perl/ch-2.pl18
-rwxr-xr-xchallenge-197/zapwai/perl/ch-1.pl28
-rwxr-xr-xchallenge-197/zapwai/perl/ch-2.pl25
-rw-r--r--challenge-197/ziameraj16/java/MoveZero.java22
-rw-r--r--stats/pwc-challenge-196.json642
-rw-r--r--stats/pwc-current.json454
-rw-r--r--stats/pwc-language-breakdown-summary.json50
-rw-r--r--stats/pwc-language-breakdown.json1401
-rw-r--r--stats/pwc-leaders.json812
-rw-r--r--stats/pwc-summary-1-30.json110
-rw-r--r--stats/pwc-summary-121-150.json106
-rw-r--r--stats/pwc-summary-151-180.json118
-rw-r--r--stats/pwc-summary-181-210.json40
-rw-r--r--stats/pwc-summary-211-240.json128
-rw-r--r--stats/pwc-summary-241-270.json38
-rw-r--r--stats/pwc-summary-271-300.json52
-rw-r--r--stats/pwc-summary-31-60.json110
-rw-r--r--stats/pwc-summary-61-90.json48
-rw-r--r--stats/pwc-summary-91-120.json52
-rw-r--r--stats/pwc-summary.json112
120 files changed, 5753 insertions, 1944 deletions
diff --git a/challenge-196/mohammad-anwar/perl/ch-2.pl b/challenge-196/mohammad-anwar/perl/ch-2.pl
new file mode 100644
index 0000000000..3b0b339e73
--- /dev/null
+++ b/challenge-196/mohammad-anwar/perl/ch-2.pl
@@ -0,0 +1,52 @@
+#!/usr/bin/perl
+
+=head1
+
+Week 196:
+
+ https://theweeklychallenge.org/blog/perl-weekly-challenge-196
+
+Task #2: Range List
+
+ You are given a sorted unique integer array, @array.
+
+ Write a script to find all possible Number Range i.e [x, y]
+ represent range all integers from x and y (both inclusive).
+
+=cut
+
+use v5.36;
+use Test2::V0;
+
+is range_list(1,3,4,5,7), [[3,5]], 'Example 1';
+is range_list(1,2,3,6,7,9), [[1,3],[6,7]], 'Example 2';
+is range_list(0,1,2,4,5,6,8,9), [[0,2],[4,6],[8,9]], 'Example 3';
+
+done_testing;
+
+#
+#
+# METHOD
+
+sub range_list(@list) {
+ my $start = shift @list;
+ my $curr = $start;
+ my @range = ();
+
+ foreach my $next (@list) {
+ next if ($next == $curr);
+ if ($next == $curr + 1) {
+ $curr = $next;
+ }
+ else {
+ push @range, [$start, $curr]
+ if ($curr > $start);
+ $curr = $start = $next;
+ }
+ }
+
+ push @range, [$start, $curr]
+ if ($curr > $start);
+
+ return \@range;
+}
diff --git a/challenge-196/wambash/raku/ch-1.raku b/challenge-196/wambash/raku/ch-1.raku
new file mode 100644
index 0000000000..cd867a9c2c
--- /dev/null
+++ b/challenge-196/wambash/raku/ch-1