From 2d377c4939c92c5b00eeabc66237acd481b8a3f5 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Sat, 7 May 2022 00:23:56 +0100 Subject: - Added guest contribution by Conor Hoekstra. --- challenge-163/conor-hoekstra/apl/ch-2.apl | 27 +++++++++++++++++++++++++++ challenge-163/conor-hoekstra/ch-2.apl | 27 --------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 challenge-163/conor-hoekstra/apl/ch-2.apl delete mode 100644 challenge-163/conor-hoekstra/ch-2.apl diff --git a/challenge-163/conor-hoekstra/apl/ch-2.apl b/challenge-163/conor-hoekstra/apl/ch-2.apl new file mode 100644 index 0000000000..834ff7f4a5 --- /dev/null +++ b/challenge-163/conor-hoekstra/apl/ch-2.apl @@ -0,0 +1,27 @@ + summations ← {⊖⌽⍤1↑⍕¨¨⌽¨1↓{⍵,⍨⊂+\1↓⊃⍵}⍣(≢⍵)⊂⍵} + + ⍝ Tests + summations 1 2 3 4 5 +┌──┬──┬──┬──┬──┐ +│1 │2 │3 │4 │5 │ +├──┼──┼──┼──┼──┤ +│ │2 │5 │9 │14│ +├──┼──┼──┼──┼──┤ +│ │ │5 │14│28│ +├──┼──┼──┼──┼──┤ +│ │ │ │14│42│ +├──┼──┼──┼──┼──┤ +│ │ │ │ │42│ +└──┴──┴──┴──┴──┘ + summations 1 3 5 7 9 +┌──┬──┬──┬──┬──┐ +│1 │3 │5 │7 │9 │ +├──┼──┼──┼──┼──┤ +│ │3 │8 │15│24│ +├──┼──┼──┼──┼──┤ +│ │ │8 │23│47│ +├──┼──┼──┼──┼──┤ +│ │ │ │23│70│ +├──┼──┼──┼──┼──┤ +│ │ │ │ │70│ +└──┴──┴──┴──┴──┘ \ No newline at end of file diff --git a/challenge-163/conor-hoekstra/ch-2.apl b/challenge-163/conor-hoekstra/ch-2.apl deleted file mode 100644 index 834ff7f4a5..0000000000 --- a/challenge-163/conor-hoekstra/ch-2.apl +++ /dev/null @@ -1,27 +0,0 @@ - summations ← {⊖⌽⍤1↑⍕¨¨⌽¨1↓{⍵,⍨⊂+\1↓⊃⍵}⍣(≢⍵)⊂⍵} - - ⍝ Tests - summations 1 2 3 4 5 -┌──┬──┬──┬──┬──┐ -│1 │2 │3 │4 │5 │ -├──┼──┼──┼──┼──┤ -│ │2 │5 │9 │14│ -├──┼──┼──┼──┼──┤ -│ │ │5 │14│28│ -├──┼──┼──┼──┼──┤ -│ │ │ │14│42│ -├──┼──┼──┼──┼──┤ -│ │ │ │ │42│ -└──┴──┴──┴──┴──┘ - summations 1 3 5 7 9 -┌──┬──┬──┬──┬──┐ -│1 │3 │5 │7 │9 │ -├──┼──┼──┼──┼──┤ -│ │3 │8 │15│24│ -├──┼──┼──┼──┼──┤ -│ │ │8 │23│47│ -├──┼──┼──┼──┼──┤ -│ │ │ │23│70│ -├──┼──┼──┼──┼──┤ -│ │ │ │ │70│ -└──┴──┴──┴──┴──┘ \ No newline at end of file -- cgit