diff options
| author | ohmycloud <ohmycloudy@gmail.com> | 2019-04-02 23:07:07 +0800 |
|---|---|---|
| committer | ohmycloud <ohmycloudy@gmail.com> | 2019-04-02 23:07:07 +0800 |
| commit | 1a9efd4d05baba135fdb2ef912bbf53589ad2b60 (patch) | |
| tree | a9f2a1308047c7c26ec5a32d1a265aa51b11e3a3 /challenge-002/ohmycloud | |
| parent | 40da7c41f248198946be9a0ffb55602bcc29e64b (diff) | |
| download | perlweeklychallenge-club-1a9efd4d05baba135fdb2ef912bbf53589ad2b60.tar.gz perlweeklychallenge-club-1a9efd4d05baba135fdb2ef912bbf53589ad2b60.tar.bz2 perlweeklychallenge-club-1a9efd4d05baba135fdb2ef912bbf53589ad2b60.zip | |
add user ohmycloud
Diffstat (limited to 'challenge-002/ohmycloud')
| -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 |
