diff options
| -rw-r--r-- | challenge-261/asherbhs/ch-1.apl | 8 | ||||
| -rw-r--r-- | challenge-261/asherbhs/ch-1.bqn | 5 | ||||
| -rw-r--r-- | challenge-261/asherbhs/ch-1.ijs | 5 | ||||
| -rw-r--r-- | challenge-261/asherbhs/ch-2.apl | 6 | ||||
| -rw-r--r-- | challenge-261/asherbhs/ch-2.bqn | 4 | ||||
| -rw-r--r-- | challenge-261/asherbhs/ch-2.ijs | 4 |
6 files changed, 25 insertions, 7 deletions
diff --git a/challenge-261/asherbhs/ch-1.apl b/challenge-261/asherbhs/ch-1.apl index bc18b22284..30cb3c0d31 100644 --- a/challenge-261/asherbhs/ch-1.apl +++ b/challenge-261/asherbhs/ch-1.apl @@ -1,5 +1,5 @@ ElementDigitSum←|⊢-⍥(+/)10(+/⊢⊤⍨(⌊1+⍟)⍴⊣)¨⊢ -ElementDigitSum 1 2 3 45 -ElementDigitSum 1 12 3 -ElementDigitSum 1 2 3 4 -ElementDigitSum 236 416 336 350 +⎕←ElementDigitSum 1 2 3 45 +⎕←ElementDigitSum 1 12 3 +⎕←ElementDigitSum 1 2 3 4 +⎕←ElementDigitSum 236 416 336 350 diff --git a/challenge-261/asherbhs/ch-1.bqn b/challenge-261/asherbhs/ch-1.bqn new file mode 100644 index 0000000000..ee314180ae --- /dev/null +++ b/challenge-261/asherbhs/ch-1.bqn @@ -0,0 +1,5 @@ +ElementDigitSum←|⊢-○(+´)(+´'0'-˜•Repr)¨ +•Show ElementDigitSum 1‿2‿3‿45 +•Show ElementDigitSum 1‿12‿3 +•Show ElementDigitSum 1‿2‿3‿4 +•Show ElementDigitSum 236‿416‿336‿350 diff --git a/challenge-261/asherbhs/ch-1.ijs b/challenge-261/asherbhs/ch-1.ijs new file mode 100644 index 0000000000..cd882f85c9 --- /dev/null +++ b/challenge-261/asherbhs/ch-1.ijs @@ -0,0 +1,5 @@ +ElementDigitSum=:[:|]-&(+/)10([:+/]#:~[$~[:<.1+^.)"0] +echo ElementDigitSum 1 2 3 45 +echo ElementDigitSum 1 12 3 +echo ElementDigitSum 1 2 3 4 +echo ElementDigitSum 236 416 336 350 diff --git a/challenge-261/asherbhs/ch-2.apl b/challenge-261/asherbhs/ch-2.apl index 034ab436bd..e9c1c6d686 100644 --- a/challenge-261/asherbhs/ch-2.apl +++ b/challenge-261/asherbhs/ch-2.apl @@ -1,4 +1,4 @@ MultiplyByTwo←{⍵∊⍺: ⍺∇2×⍵ ⋄ ⍵} -5 3 6 1 12 MultiplyByTwo 3 -1 2 4 3 MultiplyByTwo 1 -5 6 7 MultiplyByTwo 2 +⎕←5 3 6 1 12 MultiplyByTwo 3 +⎕←1 2 4 3 MultiplyByTwo 1 +⎕←5 6 7 MultiplyByTwo 2 diff --git a/challenge-261/asherbhs/ch-2.bqn b/challenge-261/asherbhs/ch-2.bqn new file mode 100644 index 0000000000..39f08f4d79 --- /dev/null +++ b/challenge-261/asherbhs/ch-2.bqn @@ -0,0 +1,4 @@ +MultiplyByTwo←{⊑𝕩∊𝕨 ? 𝕨𝕊2×𝕩 ; 𝕩} +•Show 5‿3‿6‿1‿12 MultiplyByTwo 3 +•Show 1‿2‿4‿3 MultiplyByTwo 1 +•Show 5‿6‿7 MultiplyByTwo 2 diff --git a/challenge-261/asherbhs/ch-2.ijs b/challenge-261/asherbhs/ch-2.ijs new file mode 100644 index 0000000000..df677aed4c --- /dev/null +++ b/challenge-261/asherbhs/ch-2.ijs @@ -0,0 +1,4 @@ +MultiplyByTwo=:{{ if. y e. x do. x MultiplyByTwo 2*y else. y end. }} +echo 5 3 6 1 12 MultiplyByTwo 3 +echo 1 2 4 3 MultiplyByTwo 1 +echo 5 6 7 MultiplyByTwo 2 |
