aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Hoekstra <codereport@outlook.com>2022-02-23 12:52:54 -0500
committerConor Hoekstra <codereport@outlook.com>2022-02-23 12:52:54 -0500
commit5c4f97c2cd5bd9ebfa7c84a440a78a8449645a6e (patch)
tree198f70e1b282d3ccc58824605f39d64563b44aea
parentb44719f171b42ef306e7e50933125b7b1371b38d (diff)
downloadperlweeklychallenge-club-5c4f97c2cd5bd9ebfa7c84a440a78a8449645a6e.tar.gz
perlweeklychallenge-club-5c4f97c2cd5bd9ebfa7c84a440a78a8449645a6e.tar.bz2
perlweeklychallenge-club-5c4f97c2cd5bd9ebfa7c84a440a78a8449645a6e.zip
Week 153 in APL
-rw-r--r--challenge-153/conor-hoekstra/ch-1.apl6
-rw-r--r--challenge-153/conor-hoekstra/ch-2.apl5
2 files changed, 11 insertions, 0 deletions
diff --git a/challenge-153/conor-hoekstra/ch-1.apl b/challenge-153/conor-hoekstra/ch-1.apl
new file mode 100644
index 0000000000..54b969fc95
--- /dev/null
+++ b/challenge-153/conor-hoekstra/ch-1.apl
@@ -0,0 +1,6 @@
+⍝ Left factorials from 1 to 10
+{+/!¯1+⍳⍵}¨⍳10
+
+⍝ Output
+1 2 4 10 34 154 874 5914 46234 409114
+
diff --git a/challenge-153/conor-hoekstra/ch-2.apl b/challenge-153/conor-hoekstra/ch-2.apl
new file mode 100644
index 0000000000..f3664382e4
--- /dev/null
+++ b/challenge-153/conor-hoekstra/ch-2.apl
@@ -0,0 +1,5 @@
+factorian ← {⍵=+/!10(⊥⍣¯1)⍵}
+
+⍝ Tests
+factorian ¨ 145 123 ⍝ 1 0
+