diff options
| author | Alexander <39702500+threadless-screw@users.noreply.github.com> | 2019-04-03 20:52:48 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-03 20:52:48 +0000 |
| commit | 4db60445891bf5b0542d858455711b0d11fd5f2d (patch) | |
| tree | 2a9412c7bef57f51dc0d7b3ee0b59a8255a5849d | |
| parent | 01c4ceda01fe634ae72d6f132c20eadbb629fa71 (diff) | |
| download | perlweeklychallenge-club-4db60445891bf5b0542d858455711b0d11fd5f2d.tar.gz perlweeklychallenge-club-4db60445891bf5b0542d858455711b0d11fd5f2d.tar.bz2 perlweeklychallenge-club-4db60445891bf5b0542d858455711b0d11fd5f2d.zip | |
Create ch-2.p6
| -rw-r--r-- | challenge-002/ozzy/perl6/ch-2.p6 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-002/ozzy/perl6/ch-2.p6 b/challenge-002/ozzy/perl6/ch-2.p6 new file mode 100644 index 0000000000..bda3f4c372 --- /dev/null +++ b/challenge-002/ozzy/perl6/ch-2.p6 @@ -0,0 +1,12 @@ +#!/usr/bin/env perl6 +# The obvious way to go is probably the use of Perl6' .base and .parse-base methods: + +loop { + + my Str $a = prompt("\nPlease, give me a decimal (base-10) number : "); + say("$a in decimal notation is { $a.Int.base(35) } in base-35 notation."); + + $a = prompt("\nNow give me a base-35 number [A-Y0-9]: "); + say("$a in base-35 notation is { $a.parse-base(35) } in base-10 notation.") + + } |
