« first day (1948 days earlier)      last day (701 days later) » 

12:52 PM
good morning! what's the quest today?
 
Can I post my answer right now ;)
 
If you won't be here in two hours, then sure.
Announcement: Only two months left to enter (or refer people to enter) the annual APL Problem Solving Competition.
 
1:08 PM
I believe it is {⍺÷⍺∨⍵}
 
Yup, that's one neat way to write it.
 
The problem formulation is like "Find a minimal positive number N to have 0=(○⍺)|N×○⍵"
 
1:37 PM
having the dyalog tty open in a specific directory, how do I )ed a file in that directory?
 
I you can open a new terminal to do that
 
@Razetime Doesn't )ed ./filename.ext work?
 
2:27 PM
@Adám ah the ./ is needed
 
Otherwise the interpreter cannot know that you're not referring to an APL name.
 
how do I create a new file with the given name and then )ed it?
 
Just )ed it, and it should be created.
 
hm. I just tried it and it does nothing.
 
I think the interpreter wants to ask, but the TTY provides no UI for that, so it may just answer "no". Try with RIDE.
 
2:33 PM
oh. I guess I'll just ⎕CMD the file creation then.
 
Or just ⎕NPUT it.
 
2:55 PM
quest in 5 minutes
 
Probably a short one today.
Welcome to APL Quest 2014-7! Today's quest is Revolutionary Thinking:
> Write a dfn which takes the diameters of a stationary and a mobile circle and returns the number of revolutions the mobile must traverse until the tangent points meet again.
 
tacit version of @LdBeth's solution: ⊣÷∨
 
ovs
LdBeth's answer tacified: ⊣÷∨. With ∧ ≡ ×÷∨ this can be rewritten to ∧÷⊢
 
Yeah, those two.
Heh, funny that the solution works even when rotated 180°.
 
yeah lol
 
3:03 PM
Of course, if we didn't have LCM or GCD, we'd have to implement those ourselves.
Or I guess one could simulate it by repeatedly adding until the remainder would be 0.
1{0=⍺|⍺⍺×⍵:⍺⍺ ⋄ ⍺((⍺⍺+1)∇∇)⍵} seems to work.
 
ovs
Does the test system contain cases with very large outputs?
I tried {1+⍣(0=⍺|⍵×⊣)0} but that times out
 
Probably not. Let's have a look…
@ovs Because always applies the function once.
 
/stolen from l/maths.k
gcd:*|(*:)(|!\)/,
f:{x%gcd[x;y]}

1= \f.10 10
2= \f.10 5
5= \f.5 7
 
@ovs No, never above 20.
 
ovs
@Adám But it works for the small cases, at least in 18.2
 
3:10 PM
Did you try with 0?
 
ovs
No, I see
 
@PyGamer0 Want to translate that back to APL?
 
@Adám hmm let me try...
 
APL2's idiom library has GCD←{⌈/(∧/0=V∘.|⍺ ⍵)/V←⍳⍺⌊⍵}
 
i cant port the k version..
 
3:20 PM
Oh well, then I guess we're done. Unless someone else wants to have a go.
Go The Distance coming up next week!
 
ovs
@PyGamer0 I think the gcd function is roughly {⊃⌽|\⍤⌽⍣(0=⊃⍤⊣)⍺,⍵}
or full tacit: ⊢/|\⍤⌽⍣(0=⊃⍤⊣)⍤,
Now I understand why 0|X is X, it is very convenient
 
Yup.
 
4:01 PM
Sorry, missed today's session. My final solution was exactly as mentioned.
 
@Richard Btw, some people frown at the phrase "final solution".
 
5:00 PM
What does it mean then? I meant to say I had different solutions before I discovered APL had built in GCD.
 
Oh yeah, it is perfectly clear what you meant, but people think of this.
 
5:25 PM
Ah, ok I only knew the German word. I never translate or use English for German words. Thanks for mentioning.
 

« first day (1948 days earlier)      last day (701 days later) »