From 76300514cae3d4f345faec61488e0634174caf8a Mon Sep 17 00:00:00 2001 From: Aleks-Daniel Jakimenko-Aleksejev Date: Sun, 7 Apr 2019 21:04:06 +0300 Subject: Remove unnecessary newline --- challenge-001/alex-daniel/perl6/ch-1.p6 | 1 - 1 file changed, 1 deletion(-) diff --git a/challenge-001/alex-daniel/perl6/ch-1.p6 b/challenge-001/alex-daniel/perl6/ch-1.p6 index a31ee8e172..047fbacbd1 100644 --- a/challenge-001/alex-daniel/perl6/ch-1.p6 +++ b/challenge-001/alex-daniel/perl6/ch-1.p6 @@ -1,2 +1 @@ $_ = ‘Perl Weekly Challenge’; say +tr/e/E/; .say - -- cgit From 8f7719c0ac474fe834ed9b30a3ef61edc73892aa Mon Sep 17 00:00:00 2001 From: Aleks-Daniel Jakimenko-Aleksejev Date: Sun, 7 Apr 2019 21:06:09 +0300 Subject: Link to my github account Also changes the dir name to what I prefer. --- challenge-001/alex-daniel/README | 1 - challenge-001/alex-daniel/perl6/ch-1.p6 | 1 - challenge-001/alex-daniel/perl6/ch-2.p6 | 1 - challenge-001/alexdaniel/README.md | 1 + challenge-001/alexdaniel/perl6/ch-1.p6 | 1 + challenge-001/alexdaniel/perl6/ch-2.p6 | 1 + challenge-002/alex-daniel/README | 1 - challenge-002/alexdaniel/README.md | 1 + 8 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 challenge-001/alex-daniel/README delete mode 100644 challenge-001/alex-daniel/perl6/ch-1.p6 delete mode 100644 challenge-001/alex-daniel/perl6/ch-2.p6 create mode 100644 challenge-001/alexdaniel/README.md create mode 100644 challenge-001/alexdaniel/perl6/ch-1.p6 create mode 100644 challenge-001/alexdaniel/perl6/ch-2.p6 delete mode 100644 challenge-002/alex-daniel/README create mode 100644 challenge-002/alexdaniel/README.md diff --git a/challenge-001/alex-daniel/README b/challenge-001/alex-daniel/README deleted file mode 100644 index a085722b3b..0000000000 --- a/challenge-001/alex-daniel/README +++ /dev/null @@ -1 +0,0 @@ -Solution by Alex Daniel diff --git a/challenge-001/alex-daniel/perl6/ch-1.p6 b/challenge-001/alex-daniel/perl6/ch-1.p6 deleted file mode 100644 index 047fbacbd1..0000000000 --- a/challenge-001/alex-daniel/perl6/ch-1.p6 +++ /dev/null @@ -1 +0,0 @@ -$_ = ‘Perl Weekly Challenge’; say +tr/e/E/; .say diff --git a/challenge-001/alex-daniel/perl6/ch-2.p6 b/challenge-001/alex-daniel/perl6/ch-2.p6 deleted file mode 100644 index ce84a7530b..0000000000 --- a/challenge-001/alex-daniel/perl6/ch-2.p6 +++ /dev/null @@ -1 +0,0 @@ -@=1…{put ‘Fizz’x$_%%3~‘Buzz’x$_%%5||$_}&⒛ diff --git a/challenge-001/alexdaniel/README.md b/challenge-001/alexdaniel/README.md new file mode 100644 index 0000000000..c22d28b3e8 --- /dev/null +++ b/challenge-001/alexdaniel/README.md @@ -0,0 +1 @@ +Solutions by [AlexDaniel](https://github.com/AlexDaniel/) diff --git a/challenge-001/alexdaniel/perl6/ch-1.p6 b/challenge-001/alexdaniel/perl6/ch-1.p6 new file mode 100644 index 0000000000..047fbacbd1 --- /dev/null +++ b/challenge-001/alexdaniel/perl6/ch-1.p6 @@ -0,0 +1 @@ +$_ = ‘Perl Weekly Challenge’; say +tr/e/E/; .say diff --git a/challenge-001/alexdaniel/perl6/ch-2.p6 b/challenge-001/alexdaniel/perl6/ch-2.p6 new file mode 100644 index 0000000000..ce84a7530b --- /dev/null +++ b/challenge-001/alexdaniel/perl6/ch-2.p6 @@ -0,0 +1 @@ +@=1…{put ‘Fizz’x$_%%3~‘Buzz’x$_%%5||$_}&⒛ diff --git a/challenge-002/alex-daniel/README b/challenge-002/alex-daniel/README deleted file mode 100644 index a085722b3b..0000000000 --- a/challenge-002/alex-daniel/README +++ /dev/null @@ -1 +0,0 @@ -Solution by Alex Daniel diff --git a/challenge-002/alexdaniel/README.md b/challenge-002/alexdaniel/README.md new file mode 100644 index 0000000000..c22d28b3e8 --- /dev/null +++ b/challenge-002/alexdaniel/README.md @@ -0,0 +1 @@ +Solutions by [AlexDaniel](https://github.com/AlexDaniel/) -- cgit From 033c392bcf37b969203ec5de979715a29e55e4a9 Mon Sep 17 00:00:00 2001 From: Aleks-Daniel Jakimenko-Aleksejev Date: Sun, 7 Apr 2019 22:00:55 +0300 Subject: My solutions for week 2 --- challenge-002/alexdaniel/perl6/ch-1.p6 | 9 +++++++++ challenge-002/alexdaniel/perl6/ch-2.p6 | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 challenge-002/alexdaniel/perl6/ch-1.p6 create mode 100644 challenge-002/alexdaniel/perl6/ch-2.p6 diff --git a/challenge-002/alexdaniel/perl6/ch-1.p6 b/challenge-002/alexdaniel/perl6/ch-1.p6 new file mode 100644 index 0000000000..a98b84fe71 --- /dev/null +++ b/challenge-002/alexdaniel/perl6/ch-1.p6 @@ -0,0 +1,9 @@ +# Supports any unicode digits, so ႐႐၄၂ will be trimmed to ၄၂. +# Zero and positive 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 lines diff --git a/challenge-002/alexdaniel/perl6/ch-2.p6 b/challenge-002/alexdaniel/perl6/ch-2.p6 new file mode 100644 index 0000000000..ade157486b --- /dev/null +++ b/challenge-002/alexdaniel/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 -- cgit From 124c318c71641cc4e593914fa807a629f556bbce Mon Sep 17 00:00:00 2001 From: Aleks-Daniel Jakimenko-Aleksejev Date: Sun, 7 Apr 2019 22:03:12 +0300 Subject: Oops (negative, of course) --- challenge-002/alexdaniel/perl6/ch-1.p6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenge-002/alexdaniel/perl6/ch-1.p6 b/challenge-002/alexdaniel/perl6/ch-1.p6 index a98b84fe71..9c3ed12b20 100644 --- a/challenge-002/alexdaniel/perl6/ch-1.p6 +++ b/challenge-002/alexdaniel/perl6/ch-1.p6 @@ -1,5 +1,5 @@ # Supports any unicode digits, so ႐႐၄၂ will be trimmed to ၄၂. -# Zero and positive numbers are not trimmed because the task +# 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 -- cgit From 15bf7e64bb4a56c407d265e88ff5e47be9b5c5fb Mon Sep 17 00:00:00 2001 From: Aleks-Daniel Jakimenko-Aleksejev Date: Sun, 7 Apr 2019 22:07:38 +0300 Subject: Use args instead of stdin It's easier to play with it this way. --- challenge-002/alexdaniel/perl6/ch-1.p6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenge-002/alexdaniel/perl6/ch-1.p6 b/challenge-002/alexdaniel/perl6/ch-1.p6 index 9c3ed12b20..7782c6dcea 100644 --- a/challenge-002/alexdaniel/perl6/ch-1.p6 +++ b/challenge-002/alexdaniel/perl6/ch-1.p6 @@ -6,4 +6,4 @@ # 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 lines +put S:r/^[ <:Nd> & <:Numeric_Value(0)> ]* +$>// for @*ARGS -- cgit