diff options
| author | Luca Ferrari <fluca1978@gmail.com> | 2023-11-27 15:36:11 +0100 |
|---|---|---|
| committer | Luca Ferrari <fluca1978@gmail.com> | 2023-11-27 15:36:11 +0100 |
| commit | 604e7c781e9220952021980cb1379242d5873b62 (patch) | |
| tree | 46f5f054bc6b53fc07c3009ebfd4d90c8a5ace12 | |
| parent | c059b0cd682251245b1884778f6dbd791225a8ed (diff) | |
| download | perlweeklychallenge-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.p6 | 16 |
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; +} |
