aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2021-12-27 10:47:54 +0000
committerGitHub <noreply@github.com>2021-12-27 10:47:54 +0000
commite2d52220efe383e3e0819d04c3c1f8b994c69ce6 (patch)
treeccb4326eebf786d8edeb34987b68953959a131ee
parent51be396c828dc31a152ce8181536bbd1f871f105 (diff)
parentab67f618217d8ec9f74705c39bb256cc6067ff1b (diff)
downloadperlweeklychallenge-club-e2d52220efe383e3e0819d04c3c1f8b994c69ce6.tar.gz
perlweeklychallenge-club-e2d52220efe383e3e0819d04c3c1f8b994c69ce6.tar.bz2
perlweeklychallenge-club-e2d52220efe383e3e0819d04c3c1f8b994c69ce6.zip
Merge pull request #5424 from andemark/branch-for-challenge-145
ch-1.raku
-rw-r--r--challenge-145/mark-anderson/raku/ch-1.raku12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-145/mark-anderson/raku/ch-1.raku b/challenge-145/mark-anderson/raku/ch-1.raku
new file mode 100644
index 0000000000..6f0c05cd55
--- /dev/null
+++ b/challenge-145/mark-anderson/raku/ch-1.raku
@@ -0,0 +1,12 @@
+#!/usr/bin/env raku
+
+use Test;
+
+is dot-product((1, 2, 3), (4, 5, 6)), 32;
+is dot-product((1, 2, 3, 4), (4, 5, 6, 7), (7, 8, 9, 1)), 298;
+is dot-product((1, 2, 3, 4), (4, 5, 6, 7), (7, 8, 9, 1), (2, 3, 4, 5)), 1084;
+
+sub dot-product(+@a)
+{
+ sum [>>*<<] @a;
+}