The APL Orchard

apl.chat ― Learn, teach, ask, code, golf, & discuss usage. See ...
Ven
Nov 13, 2024 11:15
@Adám reverse mask, bit mask or something like that I think
Ven
Nov 12, 2024 16:50
@Adám ugh, I guess I typed it wrong both times... Thanks. (and I did, but didn't try inverse)
Ven
Nov 12, 2024 16:25
So something like ⍳∘(⌈/)∊⊢ / ⊢∊⍨⍳(⌈/)
Ven
Nov 12, 2024 16:22
the max size is just the highest here, but that's easily configurable with ⍺←⌈/⍵
Ven
Nov 12, 2024 16:21
⍸⍤¯1⊢1 4
Ven
Nov 12, 2024 16:21
@Adám I tried that, but that didn't work
Ven
Nov 12, 2024 15:30
o/, is there a built-in/simpler version for inverse of where? I wrote {1@⍵⊢0⍴⍨⌈/⍵}, but I seem to remember there was an easier way...
Ven
Nov 1, 2024 16:18
it's back! got it
Ven
Nov 1, 2024 16:14
I submitted my final answer and it went down :(
Ven
Oct 23, 2024 12:50
Done, thanks again.
@Adám The link to QuadDiamond mode documentation seems broken on ?Dyalog_APL_Vision
Ven
Oct 23, 2024 11:54
Oops, thanks, unspaced that :)
Ven
Oct 23, 2024 09:20
Yesterday's challenge: https://codegolf.stackexchange.com/a/276250/8328
I have to short-circuit, I can't just compute both and `OR` them, because `2=0+.=(⍳⍵)` fails for the two elements case.
Input welcome :).
Ven
Oct 23, 2024 09:19
o/, I have a general question I can phrase in a specific manner.
I'm working on https://codegolf.stackexchange.com/questions/276269/building-skyscrapers, and I ended up with this:

{⍸((⍵=2)×2|⍳⍴⍵)∨{(~2|+/⍵) (∨/2=⍵) 0[⍵[1]]}⌺3⊢⍵}

Now while this *works*, it doesn't very feel very array-ish, but I'm not sure how to refactor this best. I've also solved a challenge yesterday in which I did "selection", but not being able to make an array of functions I can index into and call messes with my brain.
Ven
Oct 6, 2024 21:47
that's good to know
Ven
Oct 6, 2024 21:46
so I can just close my link and reopen it on #?
Ven
Oct 6, 2024 21:43
I don't tend to use any management features at all, be it namespaces, classes, control statements, ...
Ven
Oct 6, 2024 21:43
everything's great
Ven
Oct 6, 2024 21:41
thanks :)
Ven
Oct 6, 2024 21:41
yeah just found it
Ven
Oct 6, 2024 21:39
er, maybe not
Ven
Oct 6, 2024 21:38
Pretty sure it's ⎕SE.Dyalog.StartupSession.AllPaths
Ven
Oct 6, 2024 21:38
@Adám I'll try to find that, thanks
Ven
Oct 6, 2024 21:30
@Adám not sure how to define it in the namespace then. ns.Cat←Cat or ]Lazy ns.Cat, can it be done this way?
Ven
Oct 6, 2024 21:24
and -reset reloads permanent, oops
Ven
Oct 6, 2024 21:20
Oops, I forgot the , and now I removed my commands :D
Ven
Oct 6, 2024 21:03
Thanks! There's a lot I'm not used to, and a lot of documentation regarding links :)
Ven
Oct 6, 2024 20:02
or maybe trains etc can't be exported as such?
Ven
Oct 6, 2024 19:55
(IDE: Version: 4.5.4100 Interpreter: Version: 19.0.50027 Platform: Mac-64 Edition: Unicode/64)
Ven
Oct 6, 2024 19:55
(I have to export manually it seems, not sure if that's intended? it told me initially I didn't have dotnet installed but I do, it might not be able to find it however)
Ven
Oct 6, 2024 19:51
ah, is cat an invalid name?
Ven
Oct 6, 2024 19:49
o/, question wrt Links. I did a simple ]LINK.Create foo /.../, then foo.Cat←↑ ,⍥⊂, then ]LINK.Export, it fails to export Cat
Ven
Dec 5, 2023 10:03
Hm, maybe I should actually start from my part1 solution, produce the list of positions <=> numbers, and reuse that
Ven
Dec 4, 2023 22:57
For the basic example of course, on my input it gives "That's not the right answer; your answer is too high" and I'm way too tired to debug that now.
Ven
Dec 4, 2023 22:55
I got to this and... it looks like it works.


parsed←↑' '(≠⊆⊢)input
map←(⍴parsed)⍴d×+\2</0,d←(,parsed)∊⎕D
nums←⍎¨(input∊⎕D)⊆input
pos←↑{⊂∪0~⍨,3(↑⍤1)(⍵[2]-2)(↓⍤1)3↑(⍵[1]-2)↓map}¨⍸'*'=parsed
+/{((2=⍴)××/)nums[⍵]}¨pos
Ven
Dec 4, 2023 21:54
Oh, it's only two digits numbers
Ven
Dec 4, 2023 21:42
and it could be a single number above it, or one top left and one top right, or...
Ven
Dec 4, 2023 21:42
I can't partition, at least I don't think I can. I could try to take the 3x3 elements around the *, see which contain a number, but then I need to figure out where the numbers are and how to parse them
Ven
Dec 4, 2023 21:41
I'm not sure how to go about this :|
Ven
Dec 4, 2023 21:41
Mh, maybe I should try ⍸⍵∊⎕D, see which indices are relevant
Ven
Dec 4, 2023 19:15
For part2, I'm considering doing {⊂'*'=2 4⌷⍵}⌺3 7⊢parsed and parsing around
Ven
Dec 4, 2023 16:22
How many non-professionnal APL developers attend Dyalog user meetings, generally?
Ven
Dec 4, 2023 15:37
This was my first real use of stencil, and though I made a mess, I'm still glad I got it to work.
Ven
Dec 4, 2023 15:36
It doesn't need to support negative numbers, thankfully
Ven
Dec 4, 2023 13:34
Just to throw me off :-).
Ven
Dec 4, 2023 13:25
I hesitated between that and a rotate in the middle, just to throw in a bit of variety.
Ven
Dec 4, 2023 13:18
I like 2(1+⍳3)⌷⍵ :-).
Ven
Dec 4, 2023 13:13
Me too.
Ven
Dec 4, 2023 12:57
ah, the spaces are the newlines when pasted in tryapl
Ven
Dec 4, 2023 12:51
@rabbitgrowth I considered a scan, but I'm not sure how that'd look like.
Ven
Dec 4, 2023 12:23
I'll focus on part2 first