aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author冯昶 <seaker@qq.com>2021-11-29 19:20:49 +0800
committer冯昶 <seaker@qq.com>2021-11-29 19:20:49 +0800
commit08923cde36bfc9a71f9acdf6c8274355c1db9157 (patch)
tree1ac1186f2190da88d13670870f9237d0926305f5
parenta53828c517ea7368d0efc3f64779bd0853c17330 (diff)
downloadperlweeklychallenge-club-08923cde36bfc9a71f9acdf6c8274355c1db9157.tar.gz
perlweeklychallenge-club-08923cde36bfc9a71f9acdf6c8274355c1db9157.tar.bz2
perlweeklychallenge-club-08923cde36bfc9a71f9acdf6c8274355c1db9157.zip
challenge 141, raku solutions
-rwxr-xr-xchallenge-141/feng-chang/raku/ch-1.raku5
-rwxr-xr-xchallenge-141/feng-chang/raku/ch-2.raku5
2 files changed, 10 insertions, 0 deletions
diff --git a/challenge-141/feng-chang/raku/ch-1.raku b/challenge-141/feng-chang/raku/ch-1.raku
new file mode 100755
index 0000000000..ba42e19fb3
--- /dev/null
+++ b/challenge-141/feng-chang/raku/ch-1.raku
@@ -0,0 +1,5 @@
+#!/bin/env raku
+
+my method divisors(UInt:D $n : --> Seq:D) { (1..$n).grep($n %% *) }
+
+put (1..∞).grep(*.&divisors == 8)[^10];
diff --git a/challenge-141/feng-chang/raku/ch-2.raku b/challenge-141/feng-chang/raku/ch-2.raku
new file mode 100755
index 0000000000..4f47828458
--- /dev/null
+++ b/challenge-141/feng-chang/raku/ch-2.raku
@@ -0,0 +1,5 @@
+#!/bin/env raku
+
+sub MAIN(UInt:D \m, UInt:D \n) {
+ put m.comb.combinations(1 .. m.comb.elems-1)».join.grep(* %% n).elems;
+}