diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2019-04-04 10:58:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-04 10:58:18 +0100 |
| commit | d75855c75d89677d8af35a1dee75093524eb259f (patch) | |
| tree | 34e6b08afd42b8b01a12b25a5dee6ef72189ea53 | |
| parent | 9806a0cead89d364cf0b5ec1e01459eb372a77d2 (diff) | |
| parent | 1a9efd4d05baba135fdb2ef912bbf53589ad2b60 (diff) | |
| download | perlweeklychallenge-club-d75855c75d89677d8af35a1dee75093524eb259f.tar.gz perlweeklychallenge-club-d75855c75d89677d8af35a1dee75093524eb259f.tar.bz2 perlweeklychallenge-club-d75855c75d89677d8af35a1dee75093524eb259f.zip | |
Merge pull request #11 from ohmycloud/master
Solution submission weekly challenge (#2)
| -rw-r--r-- | challenge-002/ohmycloud/README | 1 | ||||
| -rw-r--r-- | challenge-002/ohmycloud/perl6/ch-1.p6 | 3 | ||||
| -rw-r--r-- | challenge-002/ohmycloud/perl6/ch-2.p6 | 13 |
3 files changed, 17 insertions, 0 deletions
diff --git a/challenge-002/ohmycloud/README b/challenge-002/ohmycloud/README new file mode 100644 index 0000000000..e993fafea7 --- /dev/null +++ b/challenge-002/ohmycloud/README @@ -0,0 +1 @@ +Solution by Ohmycloud diff --git a/challenge-002/ohmycloud/perl6/ch-1.p6 b/challenge-002/ohmycloud/perl6/ch-1.p6 new file mode 100644 index 0000000000..6cd4ddd03c --- /dev/null +++ b/challenge-002/ohmycloud/perl6/ch-1.p6 @@ -0,0 +1,3 @@ +for <00040 03.5 00.002 .02 .3 0.03> -> $n { + say ($n ~~ /^ 0* %% <?> /).postmatch; +} diff --git a/challenge-002/ohmycloud/perl6/ch-2.p6 b/challenge-002/ohmycloud/perl6/ch-2.p6 new file mode 100644 index 0000000000..fb61967308 --- /dev/null +++ b/challenge-002/ohmycloud/perl6/ch-2.p6 @@ -0,0 +1,13 @@ +# convert from base35 to base10 +sub decimal-to-base35(Str $n) { + :35($n.Str) +} + +say decimal-to-base35("OOM"); + +# convert from base10 to base35 +sub base35-to-decimal(Int $n) { + $n.base(35) +} + +say base35-to-decimal(30262);
\ No newline at end of file |
