diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2021-12-06 20:15:41 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-06 20:15:41 +0000 |
| commit | a6aecc68759c3b3c869a88457a16e8e25c117f30 (patch) | |
| tree | 1b13d3088aa690b377ce4b09d18b32a6645c4dde | |
| parent | fc635fd6ba39ee87b19282d49a9a26cf1ff9c5e1 (diff) | |
| parent | 576b2414b5710fb36761e040116b0f2b6233e359 (diff) | |
| download | perlweeklychallenge-club-a6aecc68759c3b3c869a88457a16e8e25c117f30.tar.gz perlweeklychallenge-club-a6aecc68759c3b3c869a88457a16e8e25c117f30.tar.bz2 perlweeklychallenge-club-a6aecc68759c3b3c869a88457a16e8e25c117f30.zip | |
Merge pull request #5340 from Abigail/abigail/week-142
Solution for week 142.
| -rw-r--r-- | challenge-142/abigail/README.md | 31 | ||||
| -rw-r--r-- | challenge-142/abigail/perl/ch-1.pl | 10 | ||||
| -rw-r--r-- | challenge-142/abigail/perl/ch-2.pl | 16 |
3 files changed, 26 insertions, 31 deletions
diff --git a/challenge-142/abigail/README.md b/challenge-142/abigail/README.md index 0ebe05c131..d589af7261 100644 --- a/challenge-142/abigail/README.md +++ b/challenge-142/abigail/README.md @@ -2,35 +2,4 @@ ## Part 1 -* [AWK](awk/ch-1.awk) -* [Bash](bash/ch-1.sh) -* [Bc](bc/ch-1.bc) -* [C](c/ch-1.c) -* [Go](go/ch-1.go) -* [Java](java/ch-1.java) -* [Lua](lua/ch-1.lua) -* [Node.js](node/ch-1.js) -* [Pascal](pascal/ch-1.p) * [Perl](perl/ch-1.pl) -* [Python](python/ch-1.py) -* [R](r/ch-1.r) -* [Ruby](ruby/ch-1.rb) -* [Tcl](tcl/ch-1.tcl) -* [Scheme](scheme/ch-1.scm) - -## Part 2 - -* [AWK](awk/ch-2.awk) -* [Bash](bash/ch-2.sh) -* [C](c/ch-2.c) -* [Go](go/ch-2.go) -* [Java](java/ch-2.java) -* [Lua](lua/ch-2.lua) -* [Node.js](node/ch-2.js) -* [Pascal](pascal/ch-2.p) -* [Perl](perl/ch-2.pl) -* [Python](python/ch-2.py) -* [R](r/ch-2.r) -* [Ruby](ruby/ch-2.rb) -* [Tcl](tcl/ch-2.tcl) -* [Scheme](scheme/ch-2.scm) diff --git a/challenge-142/abigail/perl/ch-1.pl b/challenge-142/abigail/perl/ch-1.pl new file mode 100644 index 0000000000..dcc92f41db --- /dev/null +++ b/challenge-142/abigail/perl/ch-1.pl @@ -0,0 +1,10 @@ +# +# This is the third week in a row where me need the divisors +# of a number. Kind of boring.... +# +# This is just a one liner, taking input from standard input. +# +# Math::Prime::divisors gives us the divisors of the first number; +# then it's a matter of grepping the ones ending with the second number. +# +perl -MMath::Prime::Util=divisors -pale '$_ = grep {/$F[1]$/} divisors $F[0]' diff --git a/challenge-142/abigail/perl/ch-2.pl b/challenge-142/abigail/perl/ch-2.pl new file mode 100644 index 0000000000..90be35c6a8 --- /dev/null +++ b/challenge-142/abigail/perl/ch-2.pl @@ -0,0 +1,16 @@ +# +# To do this, we need two things: +# +# 1. A perl with threads compiled in. +# 2. A machine with a real-time OS (Windows, and almost all Unices, +# including Linux and MacOs will not do). +# +# 2. is necessary because the algorithm critically depends on sleeping +# for an exact amount of time. Most OSses cannot do this. I don't even +# know whether perl runs on any OS which can sleep an exact amount of time. +# +# I'm not even going to bother recompiling my perl to implement some +# stupid joke. Let alone buy another box. +# + +die "$^O will not do.\n"; |
