diff options
| author | Ysmael Ebreo <Ysmael.Ebreo@latticesemi.com> | 2020-07-05 00:36:30 +0800 |
|---|---|---|
| committer | Ysmael Ebreo <Ysmael.Ebreo@latticesemi.com> | 2020-07-05 00:36:30 +0800 |
| commit | 5df154bde22b3c2d7ddcc33eada6e9e3dfc01541 (patch) | |
| tree | e6cfdedc0cbe2ea75ca569eb5ea8f8eec8f9f34d /challenge-067 | |
| parent | 4511fb4ed41fbe28a55eae6d8ddc260140b96e97 (diff) | |
| download | perlweeklychallenge-club-5df154bde22b3c2d7ddcc33eada6e9e3dfc01541.tar.gz perlweeklychallenge-club-5df154bde22b3c2d7ddcc33eada6e9e3dfc01541.tar.bz2 perlweeklychallenge-club-5df154bde22b3c2d7ddcc33eada6e9e3dfc01541.zip | |
Added perl solution ch#67
Diffstat (limited to 'challenge-067')
| -rw-r--r-- | challenge-067/yet-ebreo/perl/ch-1.pl | 15 | ||||
| -rw-r--r-- | challenge-067/yet-ebreo/perl/ch-2.pl | 6 |
2 files changed, 21 insertions, 0 deletions
diff --git a/challenge-067/yet-ebreo/perl/ch-1.pl b/challenge-067/yet-ebreo/perl/ch-1.pl new file mode 100644 index 0000000000..affdd331c4 --- /dev/null +++ b/challenge-067/yet-ebreo/perl/ch-1.pl @@ -0,0 +1,15 @@ +#!/usr/bin/perl +use strict; +use warnings; +use feature 'say'; + +use Algorithm::Combinatorics qw(combinations); + +my ($m,$n) = @ARGV; + +if (not $m && $n) { + ($m,$n) = (5,2) +} + +my @arr = (1..$m); +print "@{$_}\n" for combinations(\@arr,$n)
\ No newline at end of file diff --git a/challenge-067/yet-ebreo/perl/ch-2.pl b/challenge-067/yet-ebreo/perl/ch-2.pl new file mode 100644 index 0000000000..71e7afda49 --- /dev/null +++ b/challenge-067/yet-ebreo/perl/ch-2.pl @@ -0,0 +1,6 @@ +#!/usr/bin/perl +use strict; +use feature 'say'; + + +say $_ for glob join "",map "{".qw(-,@ ABC DEF GHI JKL MNO PQRS TUV WXYZ)[$_-1]=~s/\B/,/gr."}", ($ARGV[0] || '35')=~/./g
\ No newline at end of file |
