diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2020-12-15 00:00:37 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-15 00:00:37 +0000 |
| commit | 05b96afc64fbcae0ef11b10fd4bd60814cc79211 (patch) | |
| tree | 4c18ca8fd4aad0f736ef3750c12be56dca2beba3 | |
| parent | 3c0c4f283ed81e3cbeae88d75b0dbc80a8a081b8 (diff) | |
| parent | 53ea4b520246528c25d50b6cb59eab139096da25 (diff) | |
| download | perlweeklychallenge-club-05b96afc64fbcae0ef11b10fd4bd60814cc79211.tar.gz perlweeklychallenge-club-05b96afc64fbcae0ef11b10fd4bd60814cc79211.tar.bz2 perlweeklychallenge-club-05b96afc64fbcae0ef11b10fd4bd60814cc79211.zip | |
Merge pull request #2982 from stuart-little/stuart-little_091
1st commit on 091
| -rwxr-xr-x | challenge-091/stuart-little/raku/ch-1.p6 | 6 | ||||
| -rwxr-xr-x | challenge-091/stuart-little/raku/ch-2.p6 | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/challenge-091/stuart-little/raku/ch-1.p6 b/challenge-091/stuart-little/raku/ch-1.p6 new file mode 100755 index 0000000000..0672d0b5ea --- /dev/null +++ b/challenge-091/stuart-little/raku/ch-1.p6 @@ -0,0 +1,6 @@ +#!/usr/bin/env perl6 +use v6; + +# run as <script> <number> + +say @*ARGS[0].comb(/(\d)$0*/).map(*.comb).map({ $_.elems, $_[0] }).flat diff --git a/challenge-091/stuart-little/raku/ch-2.p6 b/challenge-091/stuart-little/raku/ch-2.p6 new file mode 100755 index 0000000000..4adce65ddb --- /dev/null +++ b/challenge-091/stuart-little/raku/ch-2.p6 @@ -0,0 +1,12 @@ +#!/usr/bin/env perl6 +use v6; + +# run as <script> <space-separated array> + +sub jumpp(@a where *.all >= 0) { + @a[0] >= @a.elems-1 && return True; + @a[0] == 0 && return False; + return jumpp(@a[@a[0]..*]); +} + +say @*ARGS.&jumpp.Int |
