From 300cab424f6ab63626856bee8d1cdae96916e536 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Sun, 7 Apr 2019 20:33:26 +0100 Subject: - Renamed folder alexdaniel to alex-daniel. --- challenge-002/alex-daniel/perl6/ch-1.p6 | 9 +++++++++ challenge-002/alex-daniel/perl6/ch-2.p6 | 9 +++++++++ challenge-002/alexdaniel/perl6/ch-1.p6 | 9 --------- challenge-002/alexdaniel/perl6/ch-2.p6 | 9 --------- 4 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 challenge-002/alex-daniel/perl6/ch-1.p6 create mode 100644 challenge-002/alex-daniel/perl6/ch-2.p6 delete mode 100644 challenge-002/alexdaniel/perl6/ch-1.p6 delete mode 100644 challenge-002/alexdaniel/perl6/ch-2.p6 diff --git a/challenge-002/alex-daniel/perl6/ch-1.p6 b/challenge-002/alex-daniel/perl6/ch-1.p6 new file mode 100644 index 0000000000..7782c6dcea --- /dev/null +++ b/challenge-002/alex-daniel/perl6/ch-1.p6 @@ -0,0 +1,9 @@ +# Supports any unicode digits, so ႐႐၄၂ will be trimmed to ၄၂. +# Zero and negative numbers are not trimmed because the task +# specifically asks for positive numbers. However, it is not specified +# what a “number” is, and same goes for formatting requirements (e.g. +# “.5“ vs “0.5”), therefore I decided to keep it simple and just do +# the integers. So it's just a neat example on how to do unicode-aware +# number matching. + +put S:r/^[ <:Nd> & <:Numeric_Value(0)> ]* +$>// for @*ARGS diff --git a/challenge-002/alex-daniel/perl6/ch-2.p6 b/challenge-002/alex-daniel/perl6/ch-2.p6 new file mode 100644 index 0000000000..ade157486b --- /dev/null +++ b/challenge-002/alex-daniel/perl6/ch-2.p6 @@ -0,0 +1,9 @@ +#| From base 10 to base 35 +sub postfix:<₃₅>(Real() $a) { $a.base: 35 } +#| From base 35 to base 10 +sub postfix:<₁₀>( Str() $a) { $a.parse-base: 35 } + +say ‘ALEXDANIEL’₁₀; +say 836407881643061₃₅; + +# You can do non-ints too, but they won't roundtrip as you might expect diff --git a/challenge-002/alexdaniel/perl6/ch-1.p6 b/challenge-002/alexdaniel/perl6/ch-1.p6 deleted file mode 100644 index 7782c6dcea..0000000000 --- a/challenge-002/alexdaniel/perl6/ch-1.p6 +++ /dev/null @@ -1,9 +0,0 @@ -# Supports any unicode digits, so ႐႐၄၂ will be trimmed to ၄၂. -# Zero and negative numbers are not trimmed because the task -# specifically asks for positive numbers. However, it is not specified -# what a “number” is, and same goes for formatting requirements (e.g. -# “.5“ vs “0.5”), therefore I decided to keep it simple and just do -# the integers. So it's just a neat example on how to do unicode-aware -# number matching. - -put S:r/^[ <:Nd> & <:Numeric_Value(0)> ]* +$>// for @*ARGS diff --git a/challenge-002/alexdaniel/perl6/ch-2.p6 b/challenge-002/alexdaniel/perl6/ch-2.p6 deleted file mode 100644 index ade157486b..0000000000 --- a/challenge-002/alexdaniel/perl6/ch-2.p6 +++ /dev/null @@ -1,9 +0,0 @@ -#| From base 10 to base 35 -sub postfix:<₃₅>(Real() $a) { $a.base: 35 } -#| From base 35 to base 10 -sub postfix:<₁₀>( Str() $a) { $a.parse-base: 35 } - -say ‘ALEXDANIEL’₁₀; -say 836407881643061₃₅; - -# You can do non-ints too, but they won't roundtrip as you might expect -- cgit