aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Ferrari <fluca1978@gmail.com>2023-11-27 15:36:11 +0100
committerLuca Ferrari <fluca1978@gmail.com>2023-11-27 15:36:11 +0100
commit604e7c781e9220952021980cb1379242d5873b62 (patch)
tree46f5f054bc6b53fc07c3009ebfd4d90c8a5ace12
parentc059b0cd682251245b1884778f6dbd791225a8ed (diff)
downloadperlweeklychallenge-club-604e7c781e9220952021980cb1379242d5873b62.tar.gz
perlweeklychallenge-club-604e7c781e9220952021980cb1379242d5873b62.tar.bz2
perlweeklychallenge-club-604e7c781e9220952021980cb1379242d5873b62.zip
Another implementation in Raku
-rw-r--r--challenge-245/luca-ferrari/raku/ch-1b.p616
1 files changed, 16 insertions, 0 deletions
diff --git a/challenge-245/luca-ferrari/raku/ch-1b.p6 b/challenge-245/luca-ferrari/raku/ch-1b.p6
new file mode 100644
index 0000000000..f1fb96d322
--- /dev/null
+++ b/challenge-245/luca-ferrari/raku/ch-1b.p6
@@ -0,0 +1,16 @@
+#!raku
+
+#
+# Perl Weekly Challenge 245
+# Task 1
+#
+# See <https://perlweeklychallenge.org/blog/perl-weekly-challenge-245/>
+#
+
+# $ raku raku/ch-1.p6 --langs="c" --langs="java" --langs="python" --popularity=2 --popularity=3 --popularity=5
+
+sub MAIN( :@langs where { @langs.elems == @langs.grep( * ~~ Str ).elems }
+ , :@popularity where { @popularity.elems == @langs.elems == @popularity.grep( * ~~ Int ).elems } ) {
+
+ ( @langs [Z] @popularity ).sort( { $^b[1] <=> $^a[1] } ).map( *[ 0 ] ).join( ',' ).say;
+}