« first day (1542 days earlier)      last day (1112 days later) » 

5:57 AM
Yes, that was an unfortunate design. Use ⊢∘≢≥⍳⍨
 
@Adám, I understood what you were saying about the power iterator, and I was already aware that you could form parenthetical expressions. I was merely pointing out that = doesn't need to be in parentheses.
 
@AndrewOgden Oh, I see. But any primitive function (or for that sake, named function) could be used. f⍣≡ or f⍣≢ are quite common too.
 
Which you obviously already know, I was more just using you guys as a sounding board.
Yeah, I hadn't thought of using named functions there.
 
That's a thing people often forget with APL, that named user functions have exactly the same syntactic status as the built-in ones.
 
6:14 AM
I'm really loving my APL journey :) it's just so different from anything else I've used.
 
6:26 AM
@rak1507 APL derivative time?
 
@Razetime APL′
 
6:43 AM
wow, perfect
lol @rak1507 you can try this
 
 
4 hours later…
11:09 AM
@Adám there's a simpler solution anyway if I can't use ∊ but thanks anyway
 
 
1 hour later…
12:19 PM
IsPrime←{(,'')≡⊃'^.?$|^(..+?)\1+$'⎕S'&'⊢'1'/⍨⍵}
I feel both sick and proud at the same time.
 
beautiful
 
12:35 PM
If you want to see a spectacular Dyalog crash, try running that for 27644437
Worked nicely for 7919
 
crash in what way
 
@xpqz I think {⍬≡'^.?$|^(..+?)\1+$'⎕S 3⊢'1'/⍨⍵} will do.
 
Becomes unresponsive to the extent that only way is kill -9
 
But may just be because PCRE is taking its time and refuses to stop.
 
oh, for windows it just dies in a regular way
 
1:02 PM
@Adám sorry, my fault for assuming
@rak1507 yes
 
was your solution the same as ngn's?
 
@rak1507 i guess both of you can decide amongst yourselves, but otherwise it would go to the one who got the shorter solution
@ngn nice, it looks like the challenge clarified its specification, my solution would not work for AB with CD. also nice ≢⍉↑⊆⍨ i had a longer variant
 
what was your solution?
 
@rak1507 first, what's yours? i think we have the same approach
 
1-⍨⌈/≢¨⊆⍨⊃∨/(⊢∨≠∧2=+/)¨⎕A∘∊¨⎕
(doesn't work for AB CD)
 
1:10 PM
@rak1507 can you replace (⊢∨≠∧2=+/) with something shorter?
(also similarly to ngn's, you can take input as a matrix to save a bit)
 
I found a few alternatives but they were all the same length
 
hint: it's 2 bytes long
actually not exactly
 
if you're thinking of ≠\, it doesn't work for 0 0 1 0 0
 
@rak1507 but that's invalid input, both the letters are guaranteed to be different
 
no they're not
 
1:13 PM
ah it's changed now, but from an earlier revision, 'The input will always be an array of strings, each of which has exactly two distinct characters corresponding to the trip origin and destination waypoints respectively. '
 
yeah, :/
 
so, with this being the case, how low can you get?
 
probably a lot lower, although it still won't work for the actual question with AB CD
although, ≠\ fills out the range in a weird way, so it could potentially be useful, but I doubt it's shorter than ngn's
 
the r solution used a similar approach before, after the edit it now basically does a 2/
but that means you need an extra 2÷⍨
 
1:27 PM
@ngn, so as mentioned, i've started a bounty to the shortest vanilla answer in a few days' time, which would go to you unless someone outgolfs you
 

« first day (1542 days earlier)      last day (1112 days later) »