Dyalog '18 has come to an end but the slides from presentations and workshops are being added to https://www.dyalog.com/user-meetings/dyalog18.htm – videos of presentations will start to be published soon.
I'm trying to solve the "ASCII Art Octagons" task using APL. I reached the point when I have a matrix with indices (1 or 2) and I want to use it to extract the symbols form the string ' #'. I thought it is simply ' #'[...], but apparently I miss something. My solution until now is:
@Adám in your opinion, how easy would it be to find an APL function that, when fed itself (as a string) as argument, returns a single unicode character?
Trying to code a Cops' submission for this challenge but I don't know if what I did is actually hard to break or not
I mean, I don't know you at all. Maybe its a post grad, maybe its something more specific. Maybe its more mathematical and not computer science? I'm not sure
@Adám one person does what the challenge describes, another person does a different thing that the challenge describes. It's not more complicated than that :p
@nathanrogers Jelly is an interesting exercise in how compact code can be, but of course it makes way to many sacrifices to be practically useful. I do find left-to-right intriguing though, and every once in a while I experiment with how a left-to-right APL would be.
@all What do you think of this idea? Just like A B C⌷array selects layers A, rows B, columns C, so if A B C≡⍸¨a b c then a b c/array should give the same result.
Here is a model Slash←{1=≡⍺:⍺/⍵ ⋄ ⊃{(⊃⍺)/[⊃⌽⍺]⍵}/(⍺{⍺⍵}¨(⍳≢⍺)),⊂⍵}
@dzaima I've added extensions to /⌿\⍀. I've swapped so f⍀ is ∘. and f\ is ∘.f⍨∘⍉⍨ (which is what J has for /). All four (corresponding to dzaima/APL's ⌿ and ⍀) allow a nested left argument with one vector per leading/trailing dimension (omitting dimensions is OK) and each/the vector may be short too. / and ⌿ pad with 0s; \ and ⍀ pad with 1s.
@dzaima By far most times, it is the same as ∘.f. Only when ⍺ has rank over 2 does it make a difference. I'm not sure why J chose that for outer product.
@dzaima Actually, I may be mistaken. J treats ⍺ transposed compared to APL for f.g. Not sure if that's the case for ∘.f too.
@dzaima I remember, but "correct" split is not very well defined, and if you specify it precisely, it becomes very arbitrary. Isn't this the same issue as a filter operator versus the compress function?
@dzaima Yes (except not ⍬ but rather whatever is appropriate)
Anecdote from Roger Hui: Ironic that K only has depth and not rank (>1), because Arthur Whitney invented ⍤!
@Adám non-zero numbers don't always produce ⍬, they just split the input there, and continue on. If it happens to cut off another number just after, adding a ⍬ is just logical
maybe not even writing the ⍬ would help illustrate it better. Given | b | | e f, and "normal" splitting on | gives you the result
@Adám But how would you both get 1 or more sections while also removing that element?
We need ¯0 so |⍺ is how many sections begin at each position (content in last one) and 0 means do not begin any section here; ¯0 means do not begin any section here and do not include this element; 1 mean begin one section here; ¯1 means begin one empty section here; 2 means empty section plus begin one here; ¯2 means two empty sections here.
this where pushMatrix and popMatrix are used in your code. just rotates rectangles orbiting a mass in the center.
I have a data structuring question. Location, velocity, size, mass, these are all 2d vectors, but now along comes angular motion, and I only need a scalar. Is there a problem with having a vector of alternating scalar and 0, in keeping with the 2d vectors? In dzaima apl, I'm doing `↓,/⍬ 2∘⍴¨⍵, where ⍵ is a vector of vecctors of my pairs.
having the angle be a vector of (angle1 0 angle2 0 angle3 0) means I can keep the same transformation. how else can I accomplish this?