The APL Orchard

apl.chat ― Learn, teach, ask, code, golf, & discuss usage. See ...
Mar 7, 2022 17:40
@Adám Thanks!
Mar 7, 2022 16:51
What else is new in 18.2 ? ... some more syntax highlighting styles or something along those lines I think, but I don't recall what else.
Feb 15, 2022 15:12
I would just like to say how much I appreciate this helpful community. You all entertain my questions, and are pretty polite about it when my attempts aren't optimal.
Feb 11, 2022 15:47
@Adám Thanks for hosting!
Feb 11, 2022 15:43
I feel like obfuscated is usually most appropriate as a deliberate category ...
Feb 11, 2022 15:36
@Razetime What qualifies as an enterprise solution? Do we have to use XML or CORBA or something? ;)
Feb 11, 2022 15:35
@Adám Ah, thank you.
Feb 11, 2022 15:32
I don't understand the runtime difference between the version that has (+/65≤⍵) vs +/(65≤⍵) ...
Feb 11, 2022 15:19
Typical robot ...
Feb 11, 2022 15:14
@Adám I forgot about that ...
Feb 11, 2022 15:09
The only way to win is ... not to play?
Feb 11, 2022 15:05
Here's mine: {0=≢⍵:100⋄100×+/(≥∘65÷≢)⍵}
Feb 10, 2022 16:44
@FawnLocke Ahhh ... that helps a lot. Thank you.
Feb 10, 2022 16:37
(⊂0 2 3)⌷'ABCDEF'
Feb 10, 2022 16:37
I'm talking about expressions such as:
Feb 10, 2022 16:36
Why do we often need an additional level of enclosing of the arguments of ⌷ when using it to index things? I usually mess it up and then just throw in an enclose and it works, but that's not a satisfying approach so I'd like to understand it better.
Feb 9, 2022 13:31
So is 15 the max (allowed) rank?
Feb 9, 2022 13:28
Interesting ...
Feb 9, 2022 13:17
@Adám What sort of test case?
Feb 9, 2022 13:15
But you're right that if I had just used IO 1, I wouldn't have had to monkey with the output of iota.
Feb 9, 2022 13:15
@Adám I just write my solutions using IO == 0 typically, and so when I paste them I often add the explicit specification of IO like that ...
Feb 9, 2022 13:13
Ok, that's a relief, because my solutions are collapsing under their own uglyness as I try to make them pass the test.
Feb 9, 2022 13:12
(Using , inside the function passed to key means it filled empty spots with 0 ... which is why I used @ ...)
Feb 9, 2022 13:11
{⎕IO←0⋄' '@{⍵=0}{⍺,((≢⍵)⍴'*')}⌸,⊃∘.+/1+⍳¨⍵} passes basic tests.
Feb 9, 2022 13:10
(that's what I had arrived at before trying my hand at ⍕)
Feb 9, 2022 13:09
That gets a similar error, though ... so it still isn't correct.
Feb 9, 2022 13:07
What is the intended way (maybe just a way I've written the left parameter of key incorrectly?) to get exactly the output that is desired?
Feb 9, 2022 13:06
But that differs by minor spacing and by the mixed array vs non-mixed array.
Feb 9, 2022 13:06
{⎕IO←0⋄⍕{⍺ ((≢⍵)⍴'*')}⌸,⊃∘.+/1+⍳¨⍵}
Feb 9, 2022 13:06
My best effort is:
Feb 9, 2022 13:06
I'm working on (tryapl) problem 2018 #3 ... I understand the concept, but I'm at bit of a loss for how to produce the exact output the system is looking for.
Feb 9, 2022 13:01
@FawnLocke Ok, thanks.
Feb 9, 2022 12:59
What does it mean in dyalog when a matrix is displayed with a little "+" in the lower left, when boxing is enabled? (currently with style=max)
Feb 9, 2022 12:33
So I guess maybe I'm getting extra confused by scan when I'm scanning using a non-commutative function.
Feb 9, 2022 12:30
But it didn't do quite what I expected and then I got sidetracked.
Feb 9, 2022 12:30
@dzaima Yes, I'm sure I don't have a sense yet of when to use it. This came up in the context of (tryapl) APL problem 2018 #1, where you're computing which skyscrapers you can see. So what I was trying to do was go over the list and find the places in the list where the value increased ...
Feb 9, 2022 12:28
@Adám I can work through it step by step ... and it makes sense, as long as I group things into all of those prefixes ...
Feb 9, 2022 12:23
The results of scan seem so obvious with +, and much less obvious to me in many of these other cases. I'm going to have to figure out how to get an intuitive grasp on it so I can solve problems with it.
Feb 9, 2022 12:18
@Adám Yes, that makes it explicitly clear. I just have to wrap my head around it. Thank you and @FawnLocke as well for helping me walk through it. I'll work on it a bit more and hopefully internalize this.
Feb 9, 2022 12:14
@Adám Story of my life with APL ;)
Feb 9, 2022 12:14
(Since I assumed the right hand argument is the result of the previous iteration)
Feb 9, 2022 12:14
5 > 1
Feb 9, 2022 12:14
In other words, I would have expected that the next step would be ...
Feb 9, 2022 12:13
Why is there a 5>5 there if we're going from right to left, and the previous result was 1 (due to 5 > 2 ==> 1) ?
Feb 9, 2022 12:12
Which comparison results in the 0 in the middle of the result 5 0 1 ?
Feb 9, 2022 12:11
{⎕←⍺ ⍵ (⍺>⍵)⋄⍺>⍵}\5 5 2
Feb 9, 2022 12:11
My attempts like this aren't helping:
Feb 9, 2022 12:11
I have to work on this some more. I'm not seeing it.
Feb 9, 2022 12:06
And when examining that output, it doesn't look like it's going right to left.
Feb 9, 2022 12:06
,\5 5 2